Created
December 4, 2014 03:32
-
-
Save landys/af2400a692b5243a0a6e to your computer and use it in GitHub Desktop.
Rename the machine name.
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 | |
echo This script is to rename your computer name. | |
pause | |
setlocal enableextensions enabledelayedexpansion | |
set oldname= | |
for /f "usebackq" %%i in (`hostname`) do set oldname=%%i | |
set /p newname=Please input your NEW computer name: | |
netdom renamecomputer !oldname! /newname:%newname% /force /reboot:5 | |
endlocal | |
pause |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment