I am using window 2k8 R2 server and want to achieve (1) create a user and (2) add a shortcut to the start menu of this new user.
In more detail, I tried to achieve this flow:
Step 1: create a new user account;
Step 2: call LogonUser (windows API) to log on this new user account by impersonating;
Step 3: get the path to the start menu of this new user;
Step 4: create and save a shelllink(shortcut) under the start menu path.
Then the shortcut can start an app when the new user logs in first time.
Step 3 failed because there is no user folder created for this new user even I have logged on the user account by impersonating.
So I guess the only way to create the user folders (e.g. document, download, music, pictures, start menu…) is that the user physically logs on by himself for the first time.
Is there a way to prepare the user folders and put the shortcut into the start menu for this user without the user physically logging on?