Jump to content

Autorun batch file systax


Recommended Posts

I will have a "X:\Program Files\RegImport\" folder. In this folder there will be files "1.reg", "2.reg", "3.reg" etc.

I want to run a Autorun.cmd and call it at boot and i want it to register the files in that folder. Something like below but i do not know the right systax.

If the path values can be like %programfiles% it can be more better.

@echo offset "Folder=X:\Program Files\Regimport"FOR /f "tokens=*" %%A IN ('dir X:\Program Files\Regimport) DO regsvr32 %%Aexit
Edited by Kullenen_Ask
Link to comment
Share on other sites

Which OS/PE?

I mean you could use forfiles:


In more traditional batch, it would be more something like:

@echo off
set files="X:\Program Files\Regimport\*.reg"
FOR /f "tokens=*" %%A IN ('dir /B %files%') DO ECHO regsvr32 %%A

(I changed it in such a way that only *.reg files will be listed)

But there is something "wrong". :ph34r:

Regsvr32 is to register .dll's in the registry, NOT to merge .reg fies! :w00t:


maybe you meant either of :




Link to comment
Share on other sites

Sorry there will be reg files register only with reg.exe. I wrote wrong. I will put in there forexample "7zip.reg,winrar.reg,winmount.reg...etc". I want them to be seperate because i can frequenty add or remove programs and i want all programs reg additions to be seperate. I will use in winpe. Will try your code if it works.

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...