用于创建用户配置文件的 Windows API

use*_*103 6 windows profile winapi

我正在尝试查找用于创建用户配置文件的 Window API。

我正在 Windows 中创建本地用户,并且我正在尝试使用 CreateProcessWithLogonW 并设置 LOGON_WITH_PROFILE 标志来运行该用户的进程。

由于配置文件不存在(用户尚未交互登录),因此 CreateProcessWithLogonW 失败。

与该用户执行交互式登录,然后运行该程序时,它可以工作。

任何人都知道如何使用 Win32 API 创建用户配置文件?

谢谢!利奥尔

Ole*_*leg 5

尝试使用用户配置文件 API(请参阅http://msdn.microsoft.com/en-us/library/bb776901.aspx)。在 Vista 及更高版本上,您可以使用CreateProfile. 在旧系统上,您可以使用LogonUserLoadUserProfileUnloadUserProfile(请参阅http://msdn.microsoft.com/en-us/library/bb762281.aspx)。