I made a batch script at work today to automate a few things as I was working on 15 PCs at once…
Thoguht I would share it here in case someone who happens to be in the same situation stumbles on it!
It has a number of features for example changing the PC name, changing the key for MS Office and then activating it, activating the local admin account and setting a password, auto logging a user in, and REBOOT =D
Its probably buggy, but worked 13 times out of 15 for me! so deal with it..
oh, install office doesnt work but meh. 😀
here she be:
@echo OFF
TITLE Cool Tool
color f0
:MENU
CLS
ECHO ============= COOLTOOL =============
ECHO ————————————-
ECHO 0. Install Office
ECHO 1. Activate Local Admin (Blank Password)
ECHO 2. Rename PC
ECHO 3. Auto Login “Administrator”
ECHO 4. Install office key and activate. (WARNING: INSTALL OFFICE x64 FIRST + CONNECT TO NET)
ECHO 5. Reboot PC To apply changes.
ECHO ==========PRESS ‘Q’ TO QUIT==========
ECHO.
SET INPUT=
SET /P INPUT=Please select a number:
IF /I ‘%INPUT%’==’0’ GOTO OFFICE
IF /I ‘%INPUT%’==’1’ GOTO ADMIN
IF /I ‘%INPUT%’==’2’ GOTO RENAME
IF /I ‘%INPUT%’==’3’ GOTO LOGIN
IF /I ‘%INPUT%’==’4’ GOTO OFFICEKEY
IF /I ‘%INPUT%’==’5’ GOTO REBOOT
IF /I ‘%INPUT%’==’Q’ GOTO Quit
:OFFICE
office\setup.exe
GOTO MENU
:LOGIN
echo 1st run.
REG ADD “HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon” /v AutoAdminLogon /t REG_SZ /d 1 /f
REG ADD “HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon” /v DefaultUserName /t REG_SZ /d User /f
REG ADD “HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon” /v DefaultPassword /t REG_SZ /d Password /f
echo 2nd run..
REG ADD “HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon” /v AutoAdminLogon /t REG_SZ /d 1 /f
REG ADD “HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon” /v DefaultUserName /t REG_SZ /d User /f
REG ADD “HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon” /v DefaultPassword /t REG_SZ /d Password /f
echo 3rd run…
REG ADD “HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon” /v AutoAdminLogon /t REG_SZ /d 1 /f
REG ADD “HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon” /v DefaultUserName /t REG_SZ /d User /f
REG ADD “HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon” /v DefaultPassword /t REG_SZ /d Password /f
echo 4th run….
REG ADD “HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon” /v AutoAdminLogon /t REG_SZ /d 1 /f
REG ADD “HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon” /v DefaultUserName /t REG_SZ /d User /f
REG ADD “HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon” /v DefaultPassword /t REG_SZ /d Password /f
done. =D
GOTO MENU
:RENAME
SET INPUT=
SET /P INPUT=Input Computer Number:
echo PCs new name will be: %INPUT%
pause
wmic path win32_computersystem where “Name=’%computername%'” CALL rename name=’%INPUT%’
GOTO MENU
:ADMIN
net user administrator /active:yes
net user administrator “Password”
GOTO MENU
:OFFICEKEY
cd “C:\Program Files\Microsoft Office\Office14\”
delay 3
cscript ospp.vbs /inpkey:xxxxx-xxxxx-xxxxx-xxxxx-xxxxx
echo I SET THE KEY FOR YA. Now to activate…
cscript ospp.vbs /act
echo DONE!
By the way,
The auto login runs a bunch of times because sometimes it works but doesnt…work..?
😀