Sign in to follow this  
Followers 0
scrisp

RegRead - Muliple Keys

3 posts in this topic

Hi, I'm a newbie on the forum but have been using AutoIt for a few years - on and off,

I'm trying export all the values under the following structure

HKEY_LOCAL_MACHINE\SOFTWARE\MYCOMPANY\Packages\HPAPP-WORD-21102009

HKEY_LOCAL_MACHINE\SOFTWARE\MYCOMPANY\Packages\HPAPP-EXCEL-29102009

HKEY_LOCAL_MACHINE\SOFTWARE\MYCOMPANY\Packages\HPAPP-REMEDY-19102009

I'm not limited to just those 3 items though, what I'd like to do is exort any key similar to HKEY_LOCAL_MACHINE\SOFTWARE\MYCOMPANY\Packages\HPAPP-*

or as an alternative - provide the AutoIt script a list file of keys to look for and export, if it makes it any clearer here is what I have been doing in batch alone;

======================================================================================================================================================

Echo Getting Mapped drives

regedit /e d:\Backups\%username%-%computername%-0.reg HKEY_CURRENT_USER\Network

Echo Getting Communicator settings

regedit /e %curdrive%:\Backups\%username%-%computername%-A.reg HKEY_CURRENT_USER\Software\Microsoft\Communicator

Echo Grabing Software information

regedit /e d:\Backups\%username%-%computername%-1.reg "HKEY_LOCAL_MACHINE\SOFTWARE\MYCOMPANY\Packages\HPAPP-WORD-21102009"

regedit /e d:\Backups\%username%-%computername%-2.reg "HKEY_LOCAL_MACHINE\SOFTWARE\MYCOMPANY\Packages\HPAPP-EXCEL-29102009"

regedit /e d:\Backups\%username%-%computername%-3.reg "HKEY_LOCAL_MACHINE\SOFTWARE\MYCOMPANY\Packages\HPAPP-REMEDY-19102009"

regedit /e d:\Backups\%username%-%computername%-4.reg "HKEY_LOCAL_MACHINE\SOFTWARE\MYCOMPANY\Packages\HPAPP-REMEDY-17082009"

regedit /e d:\Backups\%username%-%computername%-5.reg "HKEY_LOCAL_MACHINE\SOFTWARE\MYCOMPANY\Packages\HPAPP-ACROBAT-12092008"

regedit /e d:\Backups\%username%-%computername%-6.reg "HKEY_LOCAL_MACHINE\SOFTWARE\MYCOMPANYPackages\HPAPP-POWERPNT-29102009"

regedit /e d:\Backups\%username%-%computername%-7.reg "HKEY_LOCAL_MACHINE\SOFTWARE\MYCOMPANY\Packages\HPAPP-VISIO-31082009"

regedit /e d:\Backups\%username%-%computername%-8.reg "HKEY_LOCAL_MACHINE\SOFTWARE\MYCOMPANY\Packages\HPAPP-FILEMAKER-03062007"

regedit /e d:\Backups\%username%-%computername%-9.reg "HKEY_LOCAL_MACHINE\SOFTWARE\MYCOMPANY\Packages\HPAPP-CORELDRAW-23112008"

regedit /e d:\Backups\%username%-%computername%-B.reg "HKEY_LOCAL_MACHINE\SOFTWARE\MYCOMPANY\Packages\HPAPP-ZINC-25062007"

d:

cd Backups

copy /b %username%-%computername%-0.reg+%username%-%computername%-1.reg+%username%-%computername%-2.reg+%username%-%computername%-3.reg+%username%-%computername%-4.reg+%username%-%computername%-5.reg+%username%-%computername%-6.reg+%username%-%computername%-7.reg+%username%-%computername%-8.reg+%username%-%computername%-9.reg+%username%-%computername%-A.reg+%username%-%computername%-b.reg %username%-%computername%.reg >nul

del %username%-%computername%-*.reg /q >nul

======================================================================================================================================================

the trouble with this is that it is too limited to just the keys I have provided;

Any help or thoughts appreciated

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Welcome to the forums!

You'll of course have to modify it, but this should give you a starting point:

For $i= 1 to 10000
    $var = RegEnumKey("HKEY_LOCAL_MACHINE\SOFTWARE\MYCOMPANY\Packages", $i)
    If @error <> 0 then ExitLoop
    If StringInStr ($var, "HPAPP-") Then
        MsgBox(4096, "SubKey #" & $i & " under HKLM\SOFTWARE\MYCOMPANY\Packages: ", $var)
    EndIf
Next
Edited by exodius

Share this post


Link to post
Share on other sites

Awesome - Thanks - totaly amazing - just waht I was looking for

Steve

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