title 一键修复远程端口不监听，运行后请重新启动电脑
@echo off
cls
color ff

echo 正在设置“Terminal Service”服务... 
sc config TermService start= AUTO 
net start TermService

reg add  "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\Wds\GNR" /v "fEnableBreakDisconnect" /t REG_DWORD /d 0 /f
reg add  "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\Wds\GNR" /v "fEnableDsrSensitivity" /t REG_DWORD /d 0 /f
reg add  "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\Wds\GNR" /v "fDisableEncryption" /t REG_DWORD /d 1 /f
reg add  "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\Wds\GNR" /v "fForceClientLptDef" /t REG_DWORD /d 1 /f

reg add  "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\GNR" /v "fDisableEncryption" /t REG_DWORD /d 1 /f
reg add  "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\GNR" /v "fForceClientLptDef" /t REG_DWORD /d 1 /f

echo 提示您：一键修复远程端口不监听完成，请“重新启动电脑”即可，按任意键退出
pause