Adding a user

ilkhan

[H]F Junkie
2FA
Joined
Sep 23, 2002
Messages
13,953
Is there anyway to add an admin user account, with password, through the command line or registry?

Doubt it, but wondering.
 
'net user' contains some of what you want. Type 'net user /help' for instructions.
in particular "net user $username $password /add" will do the job (if you put the password as * you'll be prompted or it, which is more secure, since the passwords not listed in your command history)
This adds a user, to turn them into an admin you need to add them to the administrators group. This is done by "net localgroup administrators $username /add"
 
saxy_simon said:
'net user' contains some of what you want. Type 'net user /help' for instructions.
in particular "net user $username $password /add" will do the job (if you put the password as * you'll be prompted or it, which is more secure, since the passwords not listed in your command history)
This adds a user, to turn them into an admin you need to add them to the administrators group. This is done by "net localgroup administrators $username /add"
That should work, and that's a great idea to prompt yourself for the password, rather than have it displayed in the run box history.
 
thanks.
could that be put into batch file?
Im thinking yes. but wanted to check.
 
If you can run it from a command prompt, it will run in a batch file 99.9999% of the time.
 
sweet!
Thanks guys.
[H] always comes through.

is there an enviroment variable (like %windir%) that refers to the root drive of file is calling it?
Like if I wanted to open an explorer window of a USB drive that wont always be the same drive letter.
 
Back
Top