Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to import .reg files from a batch file

Status
Not open for further replies.

ccastelein

Technical User
Aug 15, 2001
35
US
Not sure if this is the correct forum for this question but i cant find anywhere better. Im trying to automate an install process and would like to import registry settings (windows 2000) via a batch file. First is this possible? Second, if so, how. Would appriciate all help. Thanks
cdc
 
REGEDIT
General Syntax:
GUI mode:

REGEDIT.EXE

Import (merge) a .REG file:

REGEDIT.EXE [ /L:system ¦ /R:user ] [ /S ] importfile.REG

Export to a (.REG) file:

REGEDIT.EXE [ /L:system ¦ /R:user ] /E exportfile "registry_key"

Compress the registry (Windows 98 only):

REGEDIT.EXE [ /L:system ¦ /R:user ] /C

Parameters:

importfile.REG .REG file to be imported (or "merged")
exportfile File name the information should be written to
"registry_key" Registry key to be exported
e.g. "HKEY_CLASSES\ROOT\*\shell"
/S Silent, i.e. hide confirmation box when importing files
/E Export registry file
/L:system Specify the location of the system.dat to use
/R:user Specify the location of the user.dat to use
/C Compress [filename] (Windows 98 only)


You'll find more info on
 
I was wondering...if you are using a current (meaning Windows) language such as VB or VC++, etc.

They usually provide a setup wizard and a list file that you can modify as necessary. Why do you want to do it from a batch file?

Why can't you create a seperate proggy (maybe call it Configuration.exe) that starts first (instead of your main.exe), installs appropriate settings, then runs your Main.exe and self-deletes? If you're changing the reg for your program, I'd think that it must be windows compatible.

Reading from, or writing to, the reg from DOS isn't all that great. --MiggyD

Never be afraid to try something new. Remember that amateurs built the Ark. Professionals built the Titanic.
 
How do you Import a saved key in to Regedt32?

I have assigned a subkey certain permissions using the security menu in Regedt32 and have saved the key. I can restore the saved key using the restore command in the file menu.

BUT, I want to be able to import this "saved key" silently without having to use the Regedt32 GUI.

Is there a way?????

I have tried importing it using Regedit but it doesn't restore the permissions on the key.

Regards


Bhogaj31
 
You can easily write a little VB application to perform this task. There are many examples in the Visual Basic (Microsoft): Version 5 & 6 forum.

vcn.gif

Suffice it to say that adding disk drives and a disk operating system to a personal microcomputer is guaranteed to increase its power dramatically.
CP/M and the Personal Computer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top