用于创建用户配置文件的Windows API [英] Windows API for Creating User Profile
问题描述
我正在尝试找到用于创建用户个人资料的Window API.
I'm trying to find the Window API for creating user profile.
我正在Windows中创建本地用户,并且试图使用设置了LOGON_WITH_PROFILE标志的CreateProcessWithLogonW与该用户一起运行进程.
I'm creating local user in windows, and i'm trying to run process with this user using CreateProcessWithLogonW with LOGON_WITH_PROFILE flag set.
由于配置文件不存在(用户尚未以交互方式登录),CreateProcessWithLogonW失败.
Since the profile does not exist (the user was not interactively logged on yet) the CreateProcessWithLogonW fails.
与该用户执行交互式登录,然后运行该程序时,它将起作用.
When performing interactive logon with this user and then running the program it works.
任何人都知道如何使用Win32 API创建用户配置文件吗?
Anyone knows how can I create user profile using Win32 API?
谢谢! 骗子
推荐答案
尝试使用 User Profiles API (请参阅 http://msdn.microsoft.com/en-us/library/bb776901.aspx ).在Vista和更高版本上,您可以使用CreateProfile
.在旧系统上,您可以使用LogonUser
和LoadUserProfile
,UnloadUserProfile
(请参见 http://msdn.microsoft.com/en-us/library/bb762281.aspx ).
Try with User Profiles API (see http://msdn.microsoft.com/en-us/library/bb776901.aspx). On Vista and later you can use CreateProfile
. On old systems you can use LogonUser
and LoadUserProfile
, UnloadUserProfile
(see http://msdn.microsoft.com/en-us/library/bb762281.aspx).
这篇关于用于创建用户配置文件的Windows API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!