修改
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\Wds\rdpwd\Tds\tcp" /v "portnumber" /t REG_DWORD /d "37000" /f
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /v "portnumber" /t REG_DWORD /d "37000" /f
查询
reg query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\Wds\rdpwd\Tds\tcp" /v "portnumber"
添加防火墙策略
netsh advfirewall firewall add rule name="desktop_port" protocol=TCP dir=in localport=37000 action=allow
原文地址:http://blog.51cto.com/xinnuo/2074407