2019獨角獸企業重金招聘Python工程師標準>>>
網絡上找到的一段代碼,保存為.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
?