当前位置: 移动技术网 > IT编程>网络>Dos/Bat > 修改Windows Server 2008 R2 的3389远程端口的Bat批处理代码

修改Windows Server 2008 R2 的3389远程端口的Bat批处理代码

2017年12月01日  | 移动技术网IT编程  | 我要评论

功能就是通过批处理实现修win2008 r2服务器远程端口为6637并加入到防火墙中

@ echo off 
color 0a 
echo ---------------------------------------------------------------------------- 
echo. 
echo 版权所有 copyright of 冰川网络
echo. 
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
echo. 

echo regedit4 >c:\windows\reg.reg

echo [hkey_local_machine\system\currentcontrolset\control\tenninal server] >> c:\windows\reg.reg

echo [hkey_local_machine\system\currentcontrolset\control\tenninal server\winstations] >> c:\windows\reg.reg

echo [hkey_local_machine\system\currentcontrolset\control\tenninal server\winstations\rdp-tcp] >> c:\windows\reg.reg 

echo "portnumber"=dword:00001a11 >> c:\windows\reg.reg echo [hkey_local_machine\system\currentcontrolset\control\terminal server\wds\rdpwd\tds\tcp] >> c:\windows\reg.reg 

echo "portnumber"=dword:00001a11 >> c:\windows\reg.reg regedit /s c:\windows\reg.reg 

@echo 修改成功3389端口成功 netsh advfirewall firewall add rule name=6673 dir=in action=allow protocol=tcp localport=6673

@echo 添加防火墙端口成功 
cmd.exe

2017-06-07 修改了一个导致无法修改成功的bug。

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网