改善Windows私下认可远程端口号

1、定位注册表,[HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlTerminal
ServerWdsrdpwdTdstcp],侧边校正PortNumber的值,选用十进制,将暗中同意的3389端口号校勘为其余的愿意的端口号,如:56996;

2、再度定位注册表,[HKEY_LOCAL_MACHINESYSTEMCurrentContro1SetControlTenninal
ServerWinStationsRDP-Tcp],右边改正PortNumber的值,采纳十进制,将端口号修正为向上申诉近似的端口号;

3、设置防火墙入站法规,将设置的端口号放行,并关闭默许的3389端口远程准则;

4、重启“Remote Desktop 瑟维斯s”服务或重启计算机后生效。

 


 

 

批管理实例:

@echo off  
color f0  
echo 修改远程桌面3389端口(支持Windows 2003 2008 2008R2 2012 2012R2 7 8 10 ,Windwos 7及以上系统请以管理员身份运行)  
echo 自动添加防火墙规则  
echo %date%   %time%  
echo    ARK  
set /p c= 请输入新的端口:  
if "%c%"=="" goto end  
goto edit  
:edit  
netsh advfirewall firewall add rule name="Remote PortNumber" dir=in action=allow protocol=TCP localport="%c%"  
netsh advfirewall firewall add rule name="Remote PortNumber" dir=in action=allow protocol=TCP localport="%c%"  
reg add "HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlTerminal ServerWdsrdpwdTdstcp" /v "PortNumber" /t REG_DWORD /d"%c%" /f  
reg add "HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlTerminal ServerWinStationsRDP-Tcp" /v "PortNumber" /t REG_DWORD/d "%c%" /f  
net stop TermService
net start TermService
echo 修改成功!
exit  
:end  
echo 修改失败  
pause