Sign in to follow this  
Followers 0
JakeJames

Delete multiple registry keys

5 posts in this topic

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)

Share this post


Link to post
Share on other sites



See the Registry Management category in the Help file.


- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
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

 

Share this post


Link to post
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.

Share this post


Link to post
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
Sign in to follow this  
Followers 0