/build/static/layout/Breadcrumb_cap_w.png

creating local user account

Trying to create local admin user accounts on windows 10 pcs.  Have been trying to run the bat script referenced in previous posts.

@echo off

net user | find /i "admin" || net user admin Password  /add 

wmic useraccount where "name=admin" set passwordexpires=TRUE

net localgroup Administrators admin /add

exit


I have tried running this with the local system account as an online shell script and online Kscript.  According to the script log, it will succeed but the account is never created.  Any ideas?


0 Comments   [ + ] Show comments

Answers (1)

Posted by: chucksteel 4 years ago
Red Belt
0

All of your Windows computers will have the "Administrator" account, so the first line of your script will never create an account (it contains the string "admin").

The script log shows it completed because the client launched the script which exits with a code of 0 (because of your last line), which means it was successful.



Comments:
  • Thanks, some days you feel dumb. I forgot that find is a string search. - KJessie 4 years ago
    • If you didn't include the /i the command would also have worked, by the way. - chucksteel 4 years ago
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ