Removing a registry key and its subkeys using a batch
I need to remove a registry key (including its subkeys) from a batch file.
The examples I found led me to the following code but th开发者_JAVA百科e key remains?
@ECHO OFF
REG DELETE "HKEY_CURRENT_USER\Software\Autodesk\AutoCAD\R18.0\ACAD-8001:409\Profiles\STDPROFILE" /V
Not so good at batch programming, but
reg query "HKEY_CURRENT_USER\Software\Autodesk\AutoCAD\R18.0\ACAD-8001:409\Profiles\STDPROFILE" /s > toDelete.txt
for /f %v in (toDelete.txt) do reg delete %v
the first line puts every key and value in a file, then the loop reads them and calls reg delete
精彩评论