网络上找到的一段代码,保存为.bat,运行修改为功,须要重启。 网络
@echo off color 0a echo ◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇◇ echo ◇◇◇◇修改远程桌面3389端口批处理◇◇◇◇ echo ◇◇◇◇◇◇技术支持:小鱼◇◇◇◇◇◇ echo ◇◇◇By:qihang01 ◇◇◇◇ 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 修改为功 pause exit :end echo 对不起,修改失败。 pause