Jump to content

Can you do regedit /s *.reg ?


LazyBoy

Recommended Posts

I have some reg files I wanna apply to windows at the end of my program installation. I numbered them 001.reg to 005.reg

Right now I have:

regedit /s %systemdrive%\registry\000.reg

regedit /s %systemdrive%\registry\001.reg

regedit /s %systemdrive%\registry\002.reg

regedit /s %systemdrive%\registry\003.reg

regedit /s %systemdrive%\registry\004.reg

regedit /s %systemdrive%\registry\005.reg

Can I just have one line instead? Like

regedit /s %systemdrive%\registry\*.reg

I was testing it and it didn't seem to get the second one and on.

Link to comment
Share on other sites


Hi. Try this. :)

@CLS & @ECHO OFF
SETLOCAL ENABLEEXTENSIONS

:: IMPORT A SERIES OF REGISTRY FILES. (1.REG TO 5.REG)
:: PLACE ALL YOUR REG FILES ALONG WITH THIS COMMAND SCRIPT IN THE SAME FOLDER.
FOR /L %%X IN (1, 1, 5) DO REGEDIT /S %%X.REG

EXIT

Warning: I did not test this. :P

EDIT: Please change your regfile names to 1.REG instead of 001.REG.

Edited by totoymola
Link to comment
Share on other sites

Hi. Try this. :)

@CLS & @ECHO OFF
SETLOCAL ENABLEEXTENSIONS

:: IMPORT A SERIES OF REGISTRY FILES. (1.REG TO 5.REG)
:: PLACE ALL YOUR REG FILES ALONG WITH THIS COMMAND SCRIPT IN THE SAME FOLDER.
FOR /L %%X IN (1, 1, 5) DO REGEDIT /S %%X.REG

EXIT

Warning: I did not test this. :P

EDIT: Please change your regfile names to 1.REG instead of 001.REG.

Small correction to your code, but otherwise it's fine:

FOR /L %X IN (1,1,5) DO REGEDIT /S %X%.REG
Or:
FOR /L %X IN (1,1,5) DO REG /IMPORT %X%.REG
Depending on personal preference.
Just needed a bit of tweaking with the environmentals. :)

Link to comment
Share on other sites

Correction to your correction:

FOR /L %X IN (1,1,5) DO REGEDIT /S %X%.REG

Or:

FOR /L %X IN (1,1,5) DO REG /IMPORT %X%.REG

Depending on personal preference.

Just needed a bit of tweaking with the environmentals. :)

The original code was fine!
Link to comment
Share on other sites

Correction to your correction:
FOR /L %X IN (1,1,5) DO REGEDIT /S %X%.REG

Or:

FOR /L %X IN (1,1,5) DO REG /IMPORT %X%.REG

Depending on personal preference.

Just needed a bit of tweaking with the environmentals. :)

The original code was fine!

Hahahahahah!!! :lol::D

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...