Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

vbscript that will export  reg keys

Posted on 2011-05-13
4
Medium Priority
?
366 Views
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\adobe
hkey_current_user\software\ipswitch
hkey_current_user\software\business objects
hkey_current_user\software\Ultra Edit

Any help will be greatly appreciated
0
Comment
Question by:chasmant
  • 3
4 Comments
 
LVL 1

Author Comment

by:chasmant
ID: 35754481
instead of  ultra edit it should be
hkey_current_user\software\\IDM Computer Solutions
0
 
LVL 1

Author Comment

by:chasmant
ID: 35754729
fogot to add that this is windows XP
0
 
LVL 13

Accepted Solution

by:
Daz_1234 earned 2000 total points
ID: 35755044
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.

Export:
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


Import:
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,
Daz.
0
 
LVL 1

Author Closing Comment

by:chasmant
ID: 35755534
thanks this will really help save time really appreciate the quick response
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Not long ago I saw a question in the VB Script forum that I thought would not take much time. You can read that question (Question ID  (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_28455246.html)28455246) Here (http…
Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Kernel Data Recovery is a renowned Data Recovery solution provider which offers wide range of softwares for both enterprise and home users with its cost-effective solutions. Let's have a quick overview of the journey and data recovery tools range he…

580 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