Hi,
I found this script on the forum and need assistance adjusting it. i would like to make the prefix (highlighted in red) before the serial number a manual input. Any assistance would be really appreciated.
@echo offfor /f "tokens=*" %%f in ('wmic bios get serialnumber /value ^| find "="') do set "%%f"
Echo My Serial Number is %serialnumber%
Set NewPCName=NYCL-%SerialNumber%
for /f "tokens=*" %%f in ('wmic computersystem get name /value ^| find "="') do set "%%f"
Set OLDPCName=%Name%
Echo %NEWPCNAME%
Echo %OLDPCNAME%
if %NEWPCNAME% == %OLDPCNAME% (
GOTO END
) ELSE (
GOTO DEPOL
)
: DEPOL
echo This computer will be renamed from %OLDPCNAME% to %NEWPCNAME%
wmic computersystem where caption='%OLDPCNAME%' rename %NEWPCNAME%
echo This computer is scheduled to restart in 60 seconds
shutdown -r -t 60
timeout 55
:END
echo end