@echo off
if [%1]==[] goto ERRFAIL else goto POKE
:POKE
echo Checking to see if %1 is online...
if exist \\%1\ADMIN$\SYSTEM32\mstsc.exe goto CONFIG else goto ERRPOKE
:CONFIG
reg add "\\%1\HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0
shutdown /m \\%1 /r /f /t 0 /c "remote shutdown requested"
goto END
:ERRPOKE
echo Error: Computer is not accessible
echo .
goto END
:ERRFAIL
echo Error: No computer name was provided
echo .
echo Usage: rdpset.bat COMPUTERNAME
echo .
goto END
:END
No comments:
Post a Comment