Batch – How to create admin user with batch file

Save this file to user.bat with your details and put it to GPO of Computer

@echo off

Net user /delete sky
Net user /delete
Net user /add superadmin Passw0rd
Net localgroup administrators superadmin /add
Net localgroup users superadmin /delete
Net user /delete admin

runas /user:superadmin /savecred "netsh firewall set opmode disable"
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f

pause