Difference between Run RunOnce and RunOnceEX

Difference between Run RunOnce and RunOnceEX

  • Run runs the command every time a user logs in.
  • RunOnce clears the registry key as soon as the command is run.
  • RunOnceEx clears the registry key on completion of the command.

RunOnce Source:  http://support.microsoft.com/kb/179365
RunOnceEX Source:  http://support.microsoft.com/kb/310593/en-us
Other reference:  http://support.microsoft.com/kb/2021405/en-us

The first article is for Windows through 2000 but applies to Windows 7 as well.

  1. HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunServicesOnce
  2. HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunServices
  3. <Logon Prompt>
  4. HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce
  5. HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run
  6. HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run
  7. StartUp Folder
  8. HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnce


With the exception of the HKEY_LOCAL_MACHINE\…\RunOnce key, all keys and their
entries are loaded asynchronously. Therefore, all entries in the RunServices and
RunServicesOnce keys can potentially run at the same time.

Entries in the HKEY_LOCAL_MACHINE\…\RunOnce key are loaded synchronously in an
undefined order.

Because the HKEY_LOCAL_MACHINE\…\RunOnce key is loaded synchronously, all of its
entries must finish loading before the
and Startup Folder entries can be loaded.

The RunServicesOnce and RunServices keys are loaded before the user logs into
Windows 95, Windows 98, and Windows Me. Because these two keys run asynchronously
with the Logon dialog box, they can continue to run after the user has logged on.
However, since HKEY_LOCAL_MACHINE\…\RunOnce must load synchronously, its entries
will not begin loading until after the RunServicesOnce and RunServices keys have
finished loading.

Because of different system configurations (such as a computer that is configured
to automatically log on), any application that is dependent upon other applications
that are executed under these keys having completed must be prepared to wait until
these applications are complete. Other than this exception, the above description
applies to Microsoft Windows NT 4.0, Windows 2000, and Windows XP.

The RunOnce keys are ignored in Safe Mode.




Leave a Reply

Your email address will not be published. Required fields are marked *