|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册账号
×
::使用管理员权限运行cmd,拖上bat文件或复制内容运行
net start MpsSvc
::开启服务
::sc config MpsSvc start= auto
::开机启动
netsh advfirewall set allprofiles state on
::启用防火墙
netsh advfirewall firewall delete rule name="Allow Ping Damon" dir=in protocol=icmpv4 action=allow
netsh advfirewall firewall delete rule name="T1433" protocol=TCP dir=in localport=1433
netsh advfirewall firewall delete rule name="T4630" protocol=TCP dir=in localport=4630
netsh advfirewall firewall delete rule name="T4522" protocol=TCP dir=in localport=4522
netsh advfirewall firewall delete rule name="T9023" protocol=TCP dir=in localport=9023
netsh advfirewall firewall delete rule name="T11520" protocol=TCP dir=in localport=11520
netsh advfirewall firewall delete rule name="T211" protocol=TCP dir=in localport=211
netsh advfirewall firewall delete rule name="T8282" protocol=TCP dir=in localport=8282
netsh advfirewall firewall delete rule name="T5366" protocol=TCP dir=in localport=5366
netsh advfirewall firewall delete rule name="T80" protocol=TCP dir=in localport=80
netsh advfirewall firewall delete rule name="T3389" protocol=TCP dir=in localport=3389
netsh advfirewall firewall delete rule name="T8072" protocol=TCP dir=in localport=8072
netsh advfirewall firewall delete rule name="T1433" protocol=TCP dir=out localport=1433
netsh advfirewall firewall delete rule name="T4630" protocol=TCP dir=out localport=4630
netsh advfirewall firewall delete rule name="T4522" protocol=TCP dir=out localport=4522
netsh advfirewall firewall delete rule name="T9023" protocol=TCP dir=out localport=9023
netsh advfirewall firewall delete rule name="T11520" protocol=TCP dir=out localport=11520
netsh advfirewall firewall delete rule name="T211" protocol=TCP dir=out localport=211
netsh advfirewall firewall delete rule name="T8282" protocol=TCP dir=out localport=8282
netsh advfirewall firewall delete rule name="T5366" protocol=TCP dir=out localport=5366
netsh advfirewall firewall delete rule name="T80" protocol=TCP dir=out localport=80
netsh advfirewall firewall delete rule name="T3389" protocol=TCP dir=out localport=3389
netsh advfirewall firewall delete rule name="T8072" protocol=TCP dir=out localport=8072
netsh advfirewall firewall add rule name="Allow Ping Damon" dir=in protocol=icmpv4 action=allow
netsh advfirewall firewall add rule name="T1433" protocol=TCP dir=in localport=1433 action=allow
netsh advfirewall firewall add rule name="T4630" protocol=TCP dir=in localport=4630 action=allow
netsh advfirewall firewall add rule name="T4522" protocol=TCP dir=in localport=4522 action=allow
netsh advfirewall firewall add rule name="T9023" protocol=TCP dir=in localport=9023 action=allow
netsh advfirewall firewall add rule name="T11520" protocol=TCP dir=in localport=11520 action=allow
netsh advfirewall firewall add rule name="T211" protocol=TCP dir=in localport=211 action=allow
netsh advfirewall firewall add rule name="T8282" protocol=TCP dir=in localport=8282 action=allow
netsh advfirewall firewall add rule name="T5366" protocol=TCP dir=in localport=5366 action=allow
netsh advfirewall firewall add rule name="T80" protocol=TCP dir=in localport=80 action=allow
netsh advfirewall firewall add rule name="T3389" protocol=TCP dir=in localport=3389 action=allow
netsh advfirewall firewall add rule name="T8072" protocol=TCP dir=in localport=8072 action=allow
netsh advfirewall firewall add rule name="T1433" protocol=TCP dir=out localport=1433 action=allow
netsh advfirewall firewall add rule name="T4630" protocol=TCP dir=out localport=4630 action=allow
netsh advfirewall firewall add rule name="T4522" protocol=TCP dir=out localport=4522 action=allow
netsh advfirewall firewall add rule name="T9023" protocol=TCP dir=out localport=9023 action=allow
netsh advfirewall firewall add rule name="T11520" protocol=TCP dir=out localport=11520 action=allow
netsh advfirewall firewall add rule name="T211" protocol=TCP dir=out localport=211 action=allow
netsh advfirewall firewall add rule name="T8282" protocol=TCP dir=out localport=8282 action=allow
netsh advfirewall firewall add rule name="T5366" protocol=TCP dir=out localport=5366 action=allow
netsh advfirewall firewall add rule name="T80" protocol=TCP dir=out localport=80 action=allow
netsh advfirewall firewall add rule name="T3389" protocol=TCP dir=out localport=3389 action=allow
netsh advfirewall firewall add rule name="T8072" protocol=TCP dir=out localport=8072 action=allow
::常用端口
:echo off 旧版语法Win7&Win8.1测试无效
::netsh firewall set opmode mode = enable
::::启用防火墙
::netsh firewall set icmpsetting type=ALL mode=enable
::允许ICMP
::netsh firewall set service remotedesktop enable
::netsh firewall set portopening tcp 3389 enable
::远程桌面
@echo off
net start SessionEnv
net start TermService
::开启服务
sc config SessionEnv start= demand
sc config TermService start= demand
::开机手动启动
REG ADD "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f
::开启选项
::netsh advfirewall firewall add rule name="Remote Desktop" protocol=TCP dir=in localport=3389 action=allow
::开启3389端口
|
|