I want to be able to export key-values of registry keys as returned by reg query
.
I'm trying to write a script to find registration for a particular dll
and then write all keys to a backup file
, before trying to achieve uninstall by deleting the keys. Here's what I could come up with so far:
@echo off
reg query HKLM\SOFTWARE\Classes /s /f %1 2>&1 >NUL
if errorlevel 1 goto DLL_MISSING
for /f "tokens=1,1" %%a in ('reg query HKLM\SOFTWARE\Classes /s /f %1 2^>NUL ^| findstr /I "^HKEY_"') do (
echo %%a
REG export %%a Backup.REG
)
goto :DLL_FOUND
:DLL_MISSING
echo Assembly not found.
goto :eof
:DLL_FOUND
echo Assembly found.
Right now reg export
prompts to overwrite file, which I want append instead.
How can I achieve the same?
Also, please do suggest if there is some better way to automate uninstall duplicate(?)
installs as installed by 'regasm'.
I could prefer batch-file based solution instead of Powershell
or something else. Thanks!