metho Posted July 28, 2011 Share Posted July 28, 2011 (edited) i have a problem i have 20 (or more) user accounts, i would like to change their passwords with the following command, net user account1 NEWPASSWORDi need to create a slient batch file and execute it on number of machines i.e. running one command (net user) on various accounts listed in a text file.i dont want to do the following for each account name.net user account1 NEWPASSWORDnet user account 2 NEWPASSWORDThere has to be a better way to achieve the task, i mean i want something that would scan all the accounts and if a matching account exists on a machine it would change it. i was reading about 'for' (loop) command, tried various methods without any luck. guys any sort of help would be great. thanks Edited July 28, 2011 by metho Quote Link to comment Share on other sites More sharing options...
crp Posted July 28, 2011 Share Posted July 28, 2011 Which OS are your pc's using? Quote Link to comment Share on other sites More sharing options...
metho Posted July 28, 2011 Author Share Posted July 28, 2011 (edited) Which OS are your pc's using?Windows XP SP3 Edited July 28, 2011 by metho Quote Link to comment Share on other sites More sharing options...
crp Posted July 28, 2011 Share Posted July 28, 2011 Windows XP SP3 this should have workedfor /f %%A in (acct.lst) do call :process %%A:processnet user %1 | find "The user name could not be found"set LEGITUSER=%ERRORLEVEL%if {%LEGITUSER%}=={0} @echo net user %1 password but the errorlevel returned is always 1 when run in a batch file, even though from the command line it returns 0/1 depending if found. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.