几行bat代码命令禁止搜狗输入法所有.exe联网
本帖最后由 潘钜森 于 2024-10-13 15:35 编辑### 温馨提示:请确保 `Windows防火墙` 为 `开启` 状态
```
@echo off
:: 判断是否以管理员运行,否则重启并以管理员运行
net session >nul 2>&1
if %errorlevel% neq 0 (
PowerShell -Command "Start-Process '%~dpnx0' -Verb RunAs"
exit /b
)
:: 文件夹绝对路径
set fpath="D:\Softwares\SogouInput" >nul
:: 删除所有出入站规则
netsh advfirewall firewall delete rule name="Sogou Pinyin Service" >nul
:: 循环获取.exe并写入规则
for /r "%fpath%" %%p in (*.exe) do (
netsh advfirewall firewall add rule name="Sogou Pinyin Service" dir=inaction=block profile=any program=%%p enable=yes >nul
netsh advfirewall firewall add rule name="Sogou Pinyin Service" dir=out action=block profile=any program=%%p enable=yes >nul
)
echo Done.
pause
```
!(data/attachment/forum/202410/13/153121ggvgnlenllpol5yl.png) 火绒好像也可以写规则屏蔽 bat总感觉写着太难了QAQ 用搜狗主要是想用词库云同步
页:
[1]