我编写了这个小批处理脚本来帮助我自动清理 300 多台相同 PC 的某些非常具体的注册表项的注册表。它一直工作到将关键变量传递给“reg delete %1”命令。
@echo off
C:
cd C:\Program Files\McAfee\Common Framework\
framepkg.exe remove=agent /silent
setlocal
for /F %%c in ('REG QUERY HKLM\SOFTWARE /s^|FIND "HKEY_"^|findstr /L /I /C:"mcafee"') do call :delete %%c
endlocal
goto :EOF
:delete
reg delete /f %1
pause
Run Code Online (Sandbox Code Playgroud)
任何和所有调试帮助将不胜感激!