Created
November 2, 2015 23:40
-
-
Save acetwenty8/310daecc5754d126958c to your computer and use it in GitHub Desktop.
Script to rename Windows system to serial number
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
for /F "skip=1 delims=" %%j in ('wmic bios get serialnumber') do ( | |
set SERIAL=%%j | |
goto :DONE | |
) | |
:DONE | |
set src=%SERIAL%&set DummyForSpacesAtTheEnd=x | |
echo [%src%] | |
for /f "delims=" %%A in ('echo %src%') do call :Sub1 %%A | |
echo [%src%] | |
:Sub1 | |
set src=%* | |
wmic ComputerSystem where Name="%COMPUTERNAME%" Rename Name=%src% | |
shutdown /t 30 /r /f |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment