dazza Posted August 19, 2008 Posted August 19, 2008 I need to remove all folders in: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\ that begin with KB eg HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\KBbatman HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\KBspiderman HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\KBhulk RegEdit doesn't take wild cards (*). Show me the way people
Andreik Posted August 19, 2008 Posted August 19, 2008 I need to remove all folders in: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\ that begin with KB eg HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\KBbatman HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\KBspiderman HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\KBhulk RegEdit doesn't take wild cards (*). Show me the way people Try this: $NUM = 1 While 1 $KEY = RegEnumKey("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\",$NUM) If @error <> 0 then ExitLoop MsgBox(0,$NUM,$KEY) If StringLeft($KEY,2) = "KB" Then RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" & $KEY) EndIf $NUM += 1 WEnd
dazza Posted August 19, 2008 Author Posted August 19, 2008 Many thanks for the code but... this function deletes keys. I need folders deleted in the registry (and all keys within). Like: DirRemove($path, 1) But: RegistryDirRemove($path, 1)
ksmith247 Posted August 19, 2008 Posted August 19, 2008 Many thanks for the code but... this function deletes keys. I need folders deleted in the registry (and all keys within). Like: DirRemove($path, 1) But: RegistryDirRemove($path, 1) "Folders" are keys. "Keys" are values. There are no folders in the Windows registry. Regedit uses a folder icon to make it more visually understandable that keys hold values the way folders hold files. Support bacteria; it's the only culture most people have.LxP's Learning to Script with AutoIt 3 - Excellent starting placeVolly's Links Page - Links to cool and useful scriptsAutoIt Wrappers - Valuater's AutoIt Wrappers post. Lots of good stuff.Support AutoIt - Make a donation here; I did.[size="2"]#include <Guinness.pint>[/size]
dazza Posted August 19, 2008 Author Posted August 19, 2008 <headbutts the screen> Cheers people. I'll go and take my clever pill now.
dot45 Posted June 16, 2009 Posted June 16, 2009 <headbutts the screen>Cheers people. I'll go and take my clever pill now.I am trying to do something like this, see my thread please. http://www.autoitscript.com/forum/index.ph...mp;#entry696500I need to delete all the keys within the hklm\system\currentcontrolset\control\print\monitors\standardtcp/ip port\ports\ key. I am confused as how to get it to recursively delete all the sub keys for each key and then the key itself? Tools I've Created & Shared[/url][url="http://www.autoitscript.com/forum/index.php?showtopic=97177&st=0&p=698665&hl=printer&fromsearch=1&#entry698665"]Printer Migration Tool
Richard Robertson Posted June 16, 2009 Posted June 16, 2009 You don't need to delete subkeys. Just remove the top most key that you want to remove. It's stupid to span it first. Also, your question was not related to the thread.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now