@echo off
color 0a
title @@ 修改Windows XP/2003/2008远程桌面服务端口号 @@ echo *******************************************************************
echo * 请输入您要更改的远程桌面端口号,范围:1-65535,不能与其他端口冲突 * echo *******************************************************************
echo.
set /p port=请输入端口号:
reg add "HKLMSYSTEMCurrentControlSetControlTerminal ServerWds
dpwdTds cp" /v PortNumber /t reg_dword /d %port% /f reg add "HKLMSYSTEMCurrentControlSetControlTerminal ServerWinStationsRDP-Tcp" /v PortNumber /t reg_dword /d %port% /f
echo.
echo *******************************
echo * 重新启动远程桌面*
echo ******************************* reg add "HKLMSYSTEMCurrentControlSetControlTerminal Server" /v fDenyTSConnections /t reg_dword /d 1 /f reg add "HKLMSYSTEMCurrentControlSetControlTerminal Server" /v fDenyTSConnections /t reg_dword /d 0 /f
echo. echo 按任意键退出...
pause>nul
exit