vbscript that will export  reg keys

Posted on 2011-05-13
Last Modified: 2012-05-11
Need a script that could export these keys to C:\temp and then after I rename the ntuser files I can then maybe have another script that will import them back
hkey_current_user\software\business objects
hkey_current_user\software\Ultra Edit

Any help will be greatly appreciated
Question by:chasmant
    LVL 1

    Author Comment

    instead of  ultra edit it should be
    hkey_current_user\software\\IDM Computer Solutions
    LVL 1

    Author Comment

    fogot to add that this is windows XP
    LVL 12

    Accepted Solution

    This is a nice simple solution, nothing fancy.  I thought since you'd need to re-import the keys again the simplest thing is to use Regedit.exe because that exports in a format it can import again.

    Option Explicit
    Dim wshShell, strOutputDir
    Set wshShell = CreateObject("WScript.Shell")
    strOutputDir = "C:\Temp\"
    wshShell.Run "Regedit /E """ & strOutputDir & "adobe.reg"" ""HKEY_CURRENT_USER\software\adobe"""
    wshShell.Run "Regedit /E """ & strOutputDir & "ipswitch.reg"" ""HKEY_CURRENT_USER\software\ipswitch"""
    wshShell.Run "Regedit /E """ & strOutputDir & "business_objects.reg"" ""HKEY_CURRENT_USER\software\business objects"""
    wshShell.Run "Regedit /E """ & strOutputDir & "IDM_Computer_Solutions.reg"" ""HKEY_CURRENT_USER\software\IDM Computer Solutions"""
    MsgBox "Export Complete!", vbInformation + vbSystemModal, "Export"

    Open in new window

    Option Explicit
    Dim wshShell, strInputDir
    Set wshShell = CreateObject("WScript.Shell")
    strInputDir = "C:\Temp\"
    wshShell.Run "Regedit /S """ & strInputDir & "adobe.reg"""
    wshShell.Run "Regedit /S """ & strInputDir & "ipswitch.reg"""
    wshShell.Run "Regedit /S """ & strInputDir & "business_objects.reg"""
    wshShell.Run "Regedit /S """ & strInputDir & "IDM_Computer_Solutions.reg"""
    MsgBox "Import Complete!", vbInformation + vbSystemModal, "Import"

    Open in new window

    Note that if the key does not exist it will not error, it will just not create the .reg file in C:\Temp.  The same for the import, if the file does not exist, it will not error.

    Hope this helps,
    LVL 1

    Author Closing Comment

    thanks this will really help save time really appreciate the quick response

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Recently I finished a vbscript that I thought I'd share.  It uses a text file with a list of server names to loop through and get various status reports, then writes them all into an Excel file.  Originally it was put together for our Altiris server…
    This article is the result of a quest to better understand Task Scheduler 2.0 and all the newer objects available in vbscript in this version over  the limited options we had scripting in Task Scheduler 1.0.  As I started my journey of knowledge I f…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now