1.

Solve : copy registry key to disk?

Answer»

Hi GUYS

Is there a way of copying a specific registry key to a drive on a computer (e.g. a usb drive) so that it can later be restored onto a new PC?
What i'm looking to do is create an application for a PIECE of software that takes a backup of all the relevant files and folders attached to the software, and relevant registry keys - so that it can be copied onto a new PC, with all the registry keys that have been backed up can replace the current ones.

CheersERUNT : http://pcug.org.au/boesen/ERUNT/ERUNT.htm

But I don't know about your other specifics...You cannot take a registry from one system and use it on another and expect it to work.Can anyone guess what he's ATTEMPTING to do ? ? ? Quote from: patio on September 12, 2010, 08:31:25 AM

Can anyone guess what he's attempting to do ? ? ?
Quote
But I don't know about your other specifics...

I kinda expected this though
 
 
 
Come on guys, his request might be legit. I've had to copy registry keys from pc to pc a few times on my network. He could be working with some custom software that requires it.

Quote from: mrbishman on September 12, 2010, 05:36:47 AM
Hi guys

Is there a way of copying a specific registry key to a drive on a computer (e.g. a usb drive) so that it can later be restored onto a new PC?
What i'm looking to do is create an application for a piece of software that takes a backup of all the relevant files and folders attached to the software, and relevant registry keys - so that it can be copied onto a new PC, with all the registry keys that have been backed up can replace the current ones.

Cheers

Sounds like you're wanting to make an application portable. Check out this link: http://portableapps.com/node/16261

Also: http://www.vmware.com/products/thinapp/don't worry... it's all very legit! lol

Basically I work with a piece of printing accounting software in my workplace. when the software is installed, it addsa few files to the C: drive, as well as adding a connection string registry key to the system within hkey_local_machine -which provides the credentials for connecting to an sql database (also set up during the installation software).
I GET a lot of call from customers who decide they want to backup the system and its data and migrate it over to a new server - and i want to create an application that does this, and which would involve the following steps:

*Stop IIS and Print Spooler services
* Copy 2 folders from C:\Program Files
*Copy a specific registry key from tree within hkey_local Machine.

Once the software has been initially set up on the other server (takes 4 minutes with an .exe), I want the application to replace the files on the C: drive with the backed up files - likewise with the single registry key.

Comprende? lol


It's easy to copy registry...
The only issue, as meationed, is the key/values might not work on another computer depending on settings and locations. It's a bit odd to do this unless it's backup, tweaking, etc.

Go to the registry editor:
1) Start > Run > type 'regedit' (without the QUOTES) and enter.
2) Location the key or folder of registry keys/values and select.
3) Go File > Export
4) Save file as something.reg and copy that onto the flash drive or where ever for backup.
4) Simply double click the file to import the keys or your application could also call this file.
Hi

What I'm thinking about is creating the interface in visual basic, and then using scripts to carry out all the procedures, rather than having to do each part manually.
Is it possible to copy the registry keys using script? If so, do you know what kind it would be? ie.e VBscript, Windows scripting, etc. Quote from: mrbishman on September 16, 2010, 01:24:47 AM
Hi

What I'm thinking about is creating the interface in visual basic, and then using scripts to carry out all the procedures, rather than having to do each part manually.
Is it possible to copy the registry keys using script? If so, do you know what kind it would be? ie.e VBscript, Windows scripting, etc.

hmm... I would suggest reposting your question in the computer programming section of the forum. I don't know how many programmers regularly check this section and you would probably get a better answer from them.Well I'm not the best with VBScript, etc, but if I remember correctly...

HKEY_CURRENT_USER or HKCU
HKEY_LOCAL_MACHINE or HKLM
HKEY_CLASSES_ROOT or HKCR
HKEY_USERS
HKEY_CURRENT_CONFIG

Quote
Dim objShell, Value
Value = 0

' First create the object shell to work with
Set objShell= WScript.CreateObject("WScript.Shell")

' Write a registry value (as a DWORD or whatever value it should be)
objShell.RegWrite "HKLM\Software\AppName\Valuename", Value, "REG_DWORD"

' Read a registry value
Value = objShell.RegRead ("HKLM\Software\AppName\Value")

' Remove a registry value
objShell.RegDelete "HKLM\Software\AppName\Valuename"

' Remove the entire registry key
objShell.RegDelete "HKLM\Software\AppName\"

WScript.Quit ' Tells the script to stop and exit.

Hope that will help or at least give you an idea.


Discussion

No Comment Found