@echo off
color 0a
echo ◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇
set /p c= 请输入你要更改后的端口:
if "%c%"=="" goto end
goto edit
:edit
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\Wds\rdpwd\Tds\tcp" /v "PortNumber" /t REG_DWORD /d "%c%" /f
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /v "PortNumber" /t REG_DWORD /d "%c%" /f
echo OK
pause
exit
:end
echo 失败
pause
注意换行
保存为3389.bat运行即可