|
Save as a bat file, click Run to enter a new port automatically when prompted, and directly download the script to change the remote desktop port
@echo off
color 0a
title @@ Modify the port number of Windows XP/2003/2008 Remote Desktop Services @@
echo *******************************************************************
echo * Please enter the remote desktop port number you want to change, range: 1-65535, cannot conflict with other ports *
echo *******************************************************************
echo.
set /p port=Please enter the port number:
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 Restart Remote Desktop
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 press any key to exit...
pause>nul
exit
|