iamwpj
iamwpj

Reputation: 190

Creating user account in CMD/PowerShell for current logged in user

We have over 100 users that need to be made users on their Windows 7 machines. It's very easy to write a script using net user, but it doesn't get us a level of automation we need. I would like to be able to detect the current logged in user and fill that into the net user.

It can be an autodetect of the %username% or we could have each user enter information in a dialog input box. I have found examples of these, but I am not an expert in batch so creating the link between the input data to net user is unclear to me. Is there someone who can fill in these gaps?

Upvotes: 1

Views: 194

Answers (1)

Endoro
Endoro

Reputation: 37589

I'm not sure, what you mean, the net command also depends strongly on local/regional language settings. What you can try:

net user "%username%" "%userdomain%"


net user "%username%" "%logonserver%"

Please see also net /? and net user /?.

Upvotes: 2

Related Questions