psexec.exe from https://download.sysinternals.com/files/PSTools.zipIn directory where psexec is havin a good time create
EnableTerminalServer.cmd with content:
set path=%path%;%~dp0
set TS=HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server
psexec /accepteula \\%1 reg add "%TS%" /v AllowTSConnections /t REG_DWORD /d 1 /f
psexec \\%1 reg add "%TS%" /v fDenyTSConnections /t REG_DWORD /d 0 /f
psexec \\%1 reg add "%TS%" /v fAllowToGetHelp /t REG_DWORD /d 1 /f
start /w mstsc /v:%1
psexec \\%1 reg add "%TS%" /v AllowTSConnections /t REG_DWORD /d 0 /f
psexec \\%1 reg add "%TS%" /v fDenyTSConnections /t REG_DWORD /d 1 /f
psexec \\%1 reg add "%TS%" /v fAllowToGetHelp /t REG_DWORD /d 0 /f
Replace %1 with remote computer nameOn Windows 7 right-click on this batch file and choose "Run As Administrator".
No comments:
Post a Comment