Chris.Casey Posted September 22, 2006 Share Posted September 22, 2006 Hi Guys,I am trying to create a local account using the net user command.So far, I have added an account by using the command net user username password /addThis only creates the account as a normal user account and I need it to be a member of the administrators group.Is there anyway you can do this using this command or similar command? Link to comment Share on other sites More sharing options...
SilverBulletUK Posted September 22, 2006 Share Posted September 22, 2006 (edited) Heya,You Could use the line:net localgroup "Administrators" username /addOr...@Echo OffCls::Enter username to be addedSet ChangeUser=Chris.Casey::Enter group user to be added toSet DestinationGroup=AdministratorsEcho Adding user...NET LOCALGROUP "%DestinationGroup%" %ChangeUser% /AddEcho.Echo Added %ChangeUser% to the %DestinationGroup% group.Echo.PauseExitSave as adduser.batHope this helps!!SilverB. Edited September 22, 2006 by SilverBulletUK Link to comment Share on other sites More sharing options...
SilverBulletUK Posted September 22, 2006 Share Posted September 22, 2006 I'm guessing that worked for you Link to comment Share on other sites More sharing options...
SilverBulletUK Posted September 22, 2006 Share Posted September 22, 2006 (edited) As an after thought, to add a few users, and add them to groups try this...AddUsers.bat@Echo OffFOR /F "skip=14 tokens=1,2,3 delims=:" %%a IN (Users.ini) DO CALL :ProcessINI %%a %%b %%cGOTO :EOF:ProcessINISet XPCDUser=%~1Set XPCDPass=%~2Set XPCDGroup=%~3IF '%XPCDUser%'=='' GOTO :USRCLEANIF '%XPCDPass%'=='' SET XPCDPass=passwordIF '%XPCDGroup%'=='' SET XPCDGroup=UsersNET USER %XPCDUser% %XPCDPass% /ADD>>NULEcho %XPCDUser% added to local system accountsNET LOCALGROUP "%XPCDGroup%" %XPCDUser% /ADD>>NULEcho Added %XPCDUser% to %XPCDGroup% group:USRCLEANSet XPCDUser=Set XPCDPass=Set XPCDGroup=:EOFUsers.ini::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::Please all user accounts to be added to the local machine::::under the [StartUserAccounts] label, in the following format;::::::::Example1= Jamie:Jamiespassword:Administrators::::Example2= Helen:secret:Users::::::::Context: Username:Password:Group::::::::Please ensure to use ':' and not ';' in user lines.::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::[StartUserAccounts]Just add all the users you need in the Users.ini file, each on a new line. Edited September 22, 2006 by SilverBulletUK Link to comment Share on other sites More sharing options...
Chris.Casey Posted September 22, 2006 Author Share Posted September 22, 2006 Got it thanks.Worked it out a few minutes after posting! Cheers. Link to comment Share on other sites More sharing options...
SilverBulletUK Posted September 22, 2006 Share Posted September 22, 2006 Aint it ALWAYS the way! lol Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now