Run Registry


Is there a way to have a winbatch script initiate a reboot using the IntControl parm and have control returned to the script AFTER the machine boots?

Reason being, I’m using WinBatch to install a product and I need to do a reboot after installation before beginning the configuration procedures, also via WinBatch.


There are three locations in the registry from which you can launch an application after a reboot:

Startup Sequence:

You can start various applications or events at controlled time in Windows, by dictating when the 32-bit process should be activated. Here is the areas in which you should assign tasks, based on when you want them to start:


– As soon as Windows enters 32-bit mode, these applications/services are started – these are running prior to the logon script, or logon box


– run after a user logs on, after the logon script finishes, but before the desktop is fully loaded in.


– once the logon script is finished, and Windows has loaded the desktop STARTUP folder from the Start Menu – last place Windows starts programs from

Here’s an example (for both Windows 95 and NT):

RegSetValue(@REGMACHINE, "SoftwareMicrosoftWindowsCurrentVersionRunOnce[wbfile]","c:whateverwbapp.exe parm1 parm2 ...")

On the next boot, c:whateverwbapp.exe parm 1 … will be run.

I used a parameter and had wbapp.exe work so that if parm1 existed, to do a goto to that value, eg:

; wbapp.wbt
if param0 then goto param1

:Reboot ; come back to here after reboot

and put the app into RunOnce with the parameter “Reboot”.

More …

RunOnce is a registry key at…


If you write a script like:


and restart windows it ought to:

  1. Run notepad.exe.
  2. Remove the registry entry for you.



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s