Jump to content
Sign in to follow this  

Export several registry keys into one file.

Recommended Posts


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! :)

Share this post

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

Share this post

Link to post
Share on other sites

Works Perfectly =)

However, I wish there was a way to remove the:

Windows Registry Editor Version 5.00

from each one :)

Edited by drorshem

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...