基于需求,针对指定软件进行防火墙设置
故此做个记录
配置环境时执行,减少操作步骤
:::15:45 2024/10/15 by LiuHEYONG
@echo off&&@chcp 65001>nul
mode con lines=10 cols=60
:startup
setlocal enabledelayedexpansion
set “o=cls&echo Version:1.0.0.0 程序更新时间:[14:24 2024/10/15]&echo.&echo “&set “z=&&echo.&echo 按任意键或等待15秒后自动退出本界面&&timeout /t 15&&exit”
set “fw= 本机的 防火墙 “&set “w=,请稍候…”
net session 1>NUL 2>NUL || goto tips
title 配置%fw%
:::config_biopsee_firewall
%o% 正在配置%fw%%w%
%o% 涉及:CE、DV、ES、PI、EP、AS
netsh advfirewall firewall delete rule name=“CE”
netsh advfirewall firewall add rule name=“CE” dir=in program=”%ProgramFiles%\Biopsee\CE\CE.exe” action=allow enable=yes profile=any
netsh advfirewall firewall delete rule name=“DV”
netsh advfirewall firewall add rule name=“DV” dir=in program=”%ProgramFiles%\Biopsee\CE\DV.exe” action=allow enable=yes profile=any
netsh advfirewall firewall delete rule name=“ES”
netsh advfirewall firewall add rule name=“ES” dir=in program=“%ProgramFiles%\Biopsee\ES\ES.exe” action=allow enable=yes profile=any
netsh advfirewall firewall delete rule name=“PI”
netsh advfirewall firewall add rule name=“PI” dir=in program=“%ProgramFiles%\Biopsee\PI\PI.exe” action=allow enable=yes profile=any
netsh advfirewall firewall delete rule name=“RunDevice”
netsh advfirewall firewall add rule name=“RunDevice” dir=in program=“%ProgramFiles%\Biopsee\PI\RunDevice.exe” action=allow enable=yes profile=any
netsh advfirewall firewall delete rule name=“RunImage”
netsh advfirewall firewall add rule name=“RunImage” dir=in program=“%ProgramFiles%\Biopsee\PI\RunImage.exe” action=allow enable=yes profile=any
netsh advfirewall firewall delete rule name=“EP”
netsh advfirewall firewall add rule name=“EP” dir=in program=“%ProgramFiles%\Biopsee\EP\EP.exe” action=allow enable=yes profile=any
netsh advfirewall firewall delete rule name=“AS”
netsh advfirewall firewall add rule name=“AS” dir=in program=“%ProgramFiles%\Biopsee\AS\AS.exe” action=allow enable=yes profile=any
color 0A
%o% 配置完毕…%z%
:oserror
color 0C
%o% 系统错误,请联系xxx。 %z%
:tips
color 0C
%o% 疑似权限故障,请单击本文件右键中的 以管理员身份运行。%z%
endlocal