修改Windows默认远程端口号

修改Windows默认远程端口号。 

 

@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_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  
net stop TermService
net start TermService
echo 修改成功!
exit  
:end  
echo 修改失败  
pause  

 

4、重启“Remote Desktop Services”服务或重启计算机后生效。

1、定位注册表,[HKEY_LOCAL_MACHINE\SYSTEM\修改Windows默认远程端口号。CurrentControlSet\Control\Terminal
Server\Wds\rdpwd\Tds\tcp],左侧修改PortNumber的值,选用十进制,将暗中同意的3389端口号更动为别的的期待的端口号,如:56996;

批管理实例:


2、再一次定位注册表,[HKEY_LOCAL_MACHINE\SYSTEM\CurrentContro1Set\Control\Tenninal
Server\WinStations\RDP-Tcp],右边修改PortNumber的值,选拔十进制,将端口号修改为上诉同样的端口号;

必赢棋牌,3、设置防火墙入站法则,将安装的端口号放行,并关闭暗中认可的3389端口远程法则;

 

You can leave a response, or trackback from your own site.

Leave a Reply

网站地图xml地图