Dear All,
I run the operation menu to shutdown server or reboot server, with the code, but return the error code 1706. I search the error code but not to point of my problem. I copy the command to reboot , it able to do remote server reboot. Please advice.
ECHO 1 - Shutdown
ECHO 2 - Restart
ECHO 3 - Ping test
ECHO 4 - Quit
ECHO.
SET /p M=Type 1 2 3 4 then press ENTER:
IF %M%==1 GOTO PING
IF %M%==2 GOTO SHUTDOWN
IF %M%==3 GOTO RESTART
IF %M%==4 GOTO QUIT
:PING
set /p servername=" Enter the server name "
set /p yesno=Are you ping the "%servername%" ? [y/n]
IF "%yesno%" == "y" GOTO CONFIRM1
IF "%yesno%" == "n" GOTO MENU
:CONFIRM1
ping "%servername%"
:SHUTDOWN
set /p servername=" Enter the server name "
set /p yesno=Shutdown the %servername% ? [y/n]
IF "%yesno%" == "y" GOTO CONFIRM2
IF "%yesno%" == "n" GOTO MENU
:CONFIRM2
shutdown -m \\"%servername%" -s
GOTO MENU
:RESTART
set /p servername=" Enter the server name "
set /p yesno=Reboot the "%servername%" ? [y/n]
IF "%yesno%" == "y" GOTO CONFIRM3
IF "%yesno%" == "n" GOTO MENU
:CONFIRM3
shutdown -m \\"%servername%" -r
GOTO MENU
exit