remove registry keys using reg.exe in a batch script
- by Lex
I've written this little batch script to help me auto-clean the registries of 300+ identical PC's of some very specific registry keys. It works right up to the point of passing the key variable to the "reg delete %1" command.
@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
Any and all debugging help would be extremely appreciated!