×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

how to import .reg files from a batch file

how to import .reg files from a batch file

how to import .reg files from a batch file

(OP)
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

RE: how to import .reg files from a batch file

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 http://www.robvanderwoude.com/index.html

RE: how to import .reg files from a batch file

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.

RE: how to import .reg files from a batch file

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

RE: how to import .reg files from a batch file

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.


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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close