Thursday, May 31, 2012 11:02 AM
I'm implementing a script(jscript, vbscript) which should create new account and copy files from my old account the the new one.
new account I'm creating using "net user /add" cmd command. But the folder with new_profile name does not generated in C:\Users directory.
I have found a way to generate that folder invoking some command using "runas /user". But it looks unprofessional.
Is there other way to generate this folder?
Thanks in advacne
Thursday, May 31, 2012 11:22 AM
yes... do what you're doing with "runas /user" and log in with it. you don't want to simply "create the folder" because that's not all that gets done when a user profile is created. there are registry keys that are generated as well as an entire folder structure beneath that username's folder.
your best bet is to create the user and then authenticate using the credentials you just created.
Thursday, May 31, 2012 12:20 PMMy script should create a profile and copy files sequentially. And the script should work without requiring system reboot or loging-off.
Is there any built-in tool or WMI to activate the profile after creating a profile via net user?
Thursday, May 31, 2012 1:19 PMi'm not aware of a way to force the OS to create the profile without using something like "runas" that will allow you to auth with those credentials (which will build the profile in the background).
Thursday, May 31, 2012 8:29 PM
If this is a stand alone workstaion and not part of a doamin you can use the copy profile utility. It allows you to copy a profile into another users folder set. You can create a dummy profile and set it up as you need then just copy it.
You can also create a custom default profile and then the new users accounts will be set up as you like when they log in for the first time.
When we do this we use the runonce key to execute a first time script that can further customize the profile. When the user logs in all for the first time the rest will be done automatically.
Saturday, June 09, 2012 7:52 PMModerator
As there has been no activity in this thread for a few days, we assume the issue is resolved. We will mark it as "answered" to assist others in similar situations. If you disagree, please reply with further information. You can unmark the answer if you wish. If a reply helped answer your question, please mark it as the answer.
Richard Mueller - MVP Directory Services
- Marked As Answer by zhanka Monday, June 11, 2012 5:56 AM