1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
| @echo off
setlocal ENABLEDELAYEDEXPANSION mode con: cols=65 lines=25 color 0a
:------------------------------------- %1 mshta vbscript:createobject("shell.application").shellexecute("""%~0""","::",,"runas",1)(window.close)&&exit /b CD /D "%~dp0" :-------------------------------------
:begin
:直接输入文件夹名字 set name=IObitUnlocker_30627 :直接输入文件夹路径 set Fpath=D:\MyBackup\综合备份\便携版·软件\神器\进程管理\进程终结IObit Unlocker\IObitUnlocker_30627
:set /p name=请输入防火墙策略名称(使用软件名即可): :set /p Fpath=请输入软件安装路径(C:\Program Files\WinRAR):
echo 您输入的防火墙策略名称是:%name% echo 您输入的软件安装路径是:%Fpath%
echo "确认请按任意键否则请按Ctrl+C取消" pause
setlocal enabledelayedexpansion set /a n=0 for /r "%Fpath%" %%i in (*.exe) do ( set /a n+=1 echo "!n!_%name%","%%i" netsh advfirewall firewall del rule name="!n!_%name%">nul 2>nul netsh advfirewall firewall add rule name="!n!_%name%" program="%%i" action=block dir=out>null echo 阻止!n!_%name%程序出站规则已添加成功 )
echo.
goto begin
|