Jump to content

Export several registry keys into one file.


Recommended Posts

Hi,

I am having trouble with exporting several registry keys to one text file.

For example I have:

ShellExecuteWait("regedit.exe","/e registry.txt HKEY_CLASSES_ROOT\.ico", @DesktopDir)

ShellExecuteWait("regedit.exe","/e registry.txt HKEY_CLASSES_ROOT\.eml", @DesktopDir)

ShellExecuteWait("regedit.exe","/e registry.txt HKEY_CLASSES_ROOT\.txt", @DesktopDir)

It only saves the last one (txt) in that file.

Is there a way to save all of them into one file?

Thanks in advance! :)

Link to comment
Share on other sites

Something like this should suffice

$path = @DesktopDir & "\registry.txt"
$cache = ""
ShellExecuteWait("regedit.exe", "/e "&$path&" HKEY_CLASSES_ROOT\.ico")
$cache &= FileRead($path)
ShellExecuteWait("regedit.exe", "/e "&$path&" HKEY_CLASSES_ROOT\.eml")
$cache &= FileRead($path)
ShellExecuteWait("regedit.exe", "/e "&$path&" HKEY_CLASSES_ROOT\.txt")
$cache &= FileRead($path)
FileOpen($path, 2)
FileWrite($path, $cache)
FileClose($path)
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...