user403103
user403103

Reputation: 165

Windows API for Creating User Profile

I'm trying to find the Window API for creating user profile.

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.

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.

Anyone knows how can I create user profile using Win32 API?

Thanks! Lior

Upvotes: 7

Views: 6009

Answers (1)

Oleg
Oleg

Reputation: 221997

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).

Upvotes: 5

Related Questions