win2008修改遠程端口

網絡上找到的一段代碼,保存爲.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
相關文章
相關標籤/搜索