Jump to content

Delete multiple registry keys


Recommended Posts

Hi everyone!

So basically I am looking for help on deleting multiple registry keys.

I found this code by browsing the autoitforum(thanks) It displays the array, but how would I start deleting some of the entries?

#include <array.au3>
Global $RegTot[1][2] = [[0, 0]]

For $i = 1 To 100
    $var = RegEnumVal("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", $i)
    If @error <> 0 Then ExitLoop
    $var1 = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", $var)

    ConsoleWrite($var)
    ConsoleWrite($var1)

    ; Resize the array while keeping existing elements
    ReDim $RegTot[$i + 1][2]
    $RegTot[$i][0] = $var
    $RegTot[$i][1] = $var1

Next

_ArrayDisplay($RegTot, "Output", -1, 1)
Link to comment
Share on other sites

 

but how would I start deleting some of the entries?

RegDelete($arrayvar) at the appropriate place in your loop.

What do you mean by some of the entries because this will delete the entire array one by one....

Bill

 

Link to comment
Share on other sites

RegDelete($arrayvar) at the appropriate place in your loop.

What do you mean by some of the entries because this will delete the entire array one by one....

Bill

Well I want a if statement will check if the registry key contains a specific string and if it does to ignore it and delete everything else. I just dont know how to do that without deleting the whole array.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...