set /p num=请输入欲修改的端口号:
if "%num%"=="" goto a
reg add HKLM\SYSTEM\CurrentControlSet\Control\Terminal" "Server\wds\rdpwd\tds\tcp /v portnumber /t REG_DWORD /d %num% /f>nul
reg add HKLM\SYSTEM\CurrentControlSet\Control\Terminal" "Server\winstations\RDP-Tcp /v portnumber /t REG_DWORD /d %num% /f>nul
echo 3389端口修改成功,重启生效...&pause
--------------------------------------------
这个是修改3389的端口号