Warning: Attempt to read property "license" on null in /home/hostingwiki/public_html/wp-content/themes/zimeiti-1/functions.php on line 1
快速修改Windows服务器端口脚本 – HostingWIKI

快速修改Windows服务器端口脚本

广告位

【摘要】在Linux中,我们可以通过修改服务器的配置文件来修改系统远程登陆的端口号,但是在Windows中会比较麻烦一些,需要我们更改注册表的信息,下面是一篇关于Windows更改服务端口的快速脚本,以达成快速修改端口号的目的。操作系统:【Windows 2012/Windows 10】解决步骤

在Linux中,我们可以通过修改服务器的配置文件来修改系统远程登陆的端口号,但是在Windows中会比较麻烦一些,需要我们更改注册表的信息,下面是一篇关于Windows更改服务端口的快速脚本,以达成快速修改端口号的目的。操作系统:【Windows 2012/Windows 10】解决步骤

快速修改Windows服务器端口脚本

@echo off
color f0
echo 修改远程桌面3389端口(支持Windows 2003 2008 2008R2 2012 2012R2  2016 7 8 10 )
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
echo 修改成功
echo 重启后生效,按任意键重启
pause
shutdown /r /t 0
exit
:end
echo 修改失败
pause

关于作者: Harrison K

为您推荐

广告位

Leave a Reply

Your email address will not be published. Required fields are marked *