Create a new user's profile from the command line

3

I am creating an installation script that should create a few users, and set some registry settings for them. In order to use reg.exe to modify their registry, I need to have the location of their ntuser.dat, normally residing in the users' home directories.

The home directories are only created during the users' first login, which is a little late for my batch file. I don't wish to have to log into each user.

Is there a way to create the home directories without logging into the users? I assume it would involve copying the "\Users\Default" directory, but what else needs to be done?

This question is similar to mine, but does not refer to the registry.

Jens

Posted 2014-10-08T09:53:24.700

Reputation: 629

Answers

2

To store default user-settings for new users the registry-key HKEY_USERS -> .DEFAULT was made.

http://blogs.technet.com/b/chad/archive/2012/04/25/tip-49-how-do-you-set-default-user-profile-registry-settings.aspx

But this approach works for all users logged in from the point of change.

If you want to add registry-entries for particular users of your (Active Directory-)Domain then you should have a look at Group Policies http://en.wikipedia.org/wiki/Group_Policy

Martin Seitl

Posted 2014-10-08T09:53:24.700

Reputation: 428

Thanks! Modifying the default profile could work for our scenario. I am unsure if the .DEFAULT Key actually would work. The link you provide does not use it, but loads the Default Hive manually. We are not in a Domain, so we can't use Group Policies. I'd rather leave the default profile unchanged, so I'll wait a little longer for other answers. =) – Jens – 2014-10-08T10:47:40.233

0

i think what you need might be /homedir and /profilepath switches of net user command, you can find full help on syntax in net help user output

ps:

you can also try making user directories using mkdir before creating accounts and then add users

user373230

Posted 2014-10-08T09:53:24.700

Reputation: