bat批處理文件:bash
@echo off color 0a title @@ 修改Windows XP/2003/2008遠程桌面服務端口號 @@ echo ******************************************************************* echo * 請輸入您要更改的遠程桌面端口號,範圍:1-65535,不能與其餘端口衝突 * echo ******************************************************************* echo. set /p port=請輸入端口號: reg add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\Wds\rdpwd\Tds\tcp" /v PortNumber /t reg_dword /d %port% /f reg add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /v PortNumber /t reg_dword /d %port% /f echo. echo ******************************* echo * 從新啓動遠程桌面* echo ******************************* reg add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t reg_dword /d 1 /f reg add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t reg_dword /d 0 /f echo. echo 按任意鍵退出... pause>nul exit