开发者

Removing a registry key and its subkeys using a batch

开发者 https://www.devze.com 2023-03-06 14:38 出处:网络
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?

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

0

精彩评论

暂无评论...
验证码 换一张
取 消