用友T3 批处理开启防火墙 1433 4630端口
net start MpsSvc
::开启服务
sc config MpsSvc start= auto
::开机启动
netsh advfirewall set allprofiles state on
::启用防火墙
rem 批处理获取管理员权限
:-------------------------------------
%1 mshta vbscript:createobject("shell.application").shellexecute("""%~0""","::",,"runas",1)(window.close)&&exit /b
CD /D "%~dp0"
:-------------------------------------
::添加阻止程序出站规则
(
echo "Office_OfficeClickToRun","%ProgramFiles%\Common Files\microsoft shared\ClickToRun\OfficeClickToRun.exe"
echo "Office_msoia","%ProgramFiles%\Microsoft Office\root\Office16\msoia.exe"
echo "Office_WINWORD","%ProgramFiles%\Microsoft Office\root\Office16\WINWORD.EXE"
echo "Office_EXCEL","%ProgramFiles%\Microsoft Office\root\Office16\EXCEL.EXE"
echo "Office_POWERPNT","%ProgramFiles%\Microsoft Office\root\Office16\POWERPNT.EXE"
echo "Office_VISIO","%ProgramFiles%\Microsoft Office\root\Office16\VISIO.EXE"
echo "Office_WINPROJ","%ProgramFiles%\Microsoft Office\root\Office16\WINPROJ.EXE"
echo "Office_MSPUB","%ProgramFiles%\Microsoft Office\root\Office16\MSPUB.EXE"
echo "Office_MSACCESS","%ProgramFiles%\Microsoft Office\root\Office16\MSACCESS.EXE"
echo "AutoCAD_LMU","%ProgramFiles%\Common Files\Autodesk Shared\AdLM\R11\LMU.exe"
echo "AutoCAD_DADispatcherService","C:\Program Files\Autodesk\AutoCAD 2016\DADispatcherService.exe"
echo "AutoCAD_acad","C:\Program Files\Autodesk\AutoCAD 2016\acad.exe"
)>list.txt
FOR /F "usebackq tokens=1,2 delims=," %%i in ( list.txt ) do (
netsh advfirewall firewall del rule name="%%i">nul 2>nul
netsh advfirewall firewall add rule name="%%i" program=%%j action=block dir=out>nul
echo 阻止%%i程序出站规则已添加
)
del list.txt
::添加阻止服务出站规则
(
echo "Windows Update","wuauserv"
)>list.txt
set svchost_exe="%%systemroot%%\system32\svchost.exe"
FOR /F "usebackq tokens=1,2 delims=," %%i in ( list.txt ) do (
netsh advfirewall firewall del rule name=%%i>nul 2>nul
netsh advfirewall firewall add rule name=%%i service=%%j action=block dir=out program="%svchost_exe%">nul
echo 阻止%%i服务出站规则已添加
)
del list.txt
::开启1433
netsh advfirewall firewall add rule name="MSSQL" protocol=TCP dir=in localport=1433 action=allow
::开启4630
netsh advfirewall firewall add rule name="T3" protocol=TCP dir=in localport=4630 action=allow
::禁止本机与IP地址9.9.9.9的入站连接
netsh advfirewall firewall add rule name="屏蔽T3更新IP" dir=in action=block remoteip="59.110.89.88/32"
::禁止本机与IP地址9.9.9.9的出站连接
netsh advfirewall firewall add rule name="屏蔽T3更新IP" dir=out action=block remoteip="59.110.89.88/32"
101.201.175.167
netsh advfirewall firewall add rule name="屏蔽T3更新IP" dir=in action=block remoteip="101.201.175.167/32"
netsh advfirewall firewall add rule name="屏蔽T3更新IP" dir=out action=block remoteip="101.201.175.167/32"
netsh advfirewall firewall add rule name="屏蔽T3更新IP" dir=in action=block remoteip="119.44.1.231/32"
netsh advfirewall firewall add rule name="屏蔽T3更新IP" dir=out action=block remoteip="119.44.1.231/32"
netsh advfirewall firewall add rule name="屏蔽T3更新IP" dir=in action=block remoteip="202.104.18.212/32"
netsh advfirewall firewall add rule name="屏蔽T3更新IP" dir=out action=block remoteip="202.104.18.212/32"
netsh advfirewall firewall add rule name="屏蔽T3更新IP" dir=in action=block remoteip="202.104.120.70/32"
netsh advfirewall firewall add rule name="屏蔽T3更新IP" dir=out action=block remoteip="202.104.120.70/32"
netsh advfirewall firewall add rule name="屏蔽T3更新IP" dir=in action=block remoteip="125.35.5.234/32"
netsh advfirewall firewall add rule name="屏蔽T3更新IP" dir=out action=block remoteip="125.35.5.234/32"
netsh advfirewall firewall add rule name="屏蔽T3更新IP" dir=in action=block remoteip="220.250.64.26/32"
netsh advfirewall firewall add rule name="屏蔽T3更新IP" dir=out action=block remoteip="220.250.64.26/32"