INFO: Run, RunOnce, RunServices, RunServicesOnce and Startup

This article was previously published under Q179365
This article explains how the Run, RunOnce, RunServices, RunServicesOnce,and RunOnce\Setup registry keys relate to each other and to the Startupfolder. It also describes the order in which these keys are loaded.

The information contained in this article supplements the followingarticle in the Microsoft Knowledge Base:
137367 Definition of the RunOnce Keys in the Registry
Please see this article for an explanation of each of these keys.
Under Microsoft Windows 95, Windows 98, and Windows Millennium Edition (Me) where all keys are supported, the keys are loaded in the following order:


<Logon Prompt>




StartUp Folder

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

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

Because the HKEY_LOCAL_MACHINE\...\RunOnce key is loaded synchronously, allof its entries must finish loading before the HKEY_LOCAL_MACHINE\...\Run,HKEY_CURRENT_USER\...\Run, HKEY_CURRENT_USER\...\RunOnce, and StartupFolder 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 afterthe user has logged on. However, since HKEY_LOCAL_MACHINE\...\RunOnce mustload synchronously, its entries will not begin loading until after theRunServicesOnce and RunServices keys have finished loading.

Because of different system configurations (such as a computer that isconfigured to automatically log on), any application that is dependant uponother applications that are executed under these keys having completed mustbe 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 not supported by Windows NT 3.51.
  • The RunOnce keys are ignored under Windows 2000 and Windows XP in Safe Mode.
For additional information on the RunOnceEx key, click the article number%2 below to view the article%2 in the Microsoft Knowledge Base:
232487 Description of RunOnceEx Registry Key
For additional information, please see the following article in theMicrosoft Knowledge Base:
137367Definition of the RunOnce Keys in the Registry
Run RunOnce RunServices RunServicesOnce Startup registry

Article ID: 179365 - Last Review: 11/21/2006 15:40:00 - Revision: 4.2

Microsoft Win32 Application Programming Interface

  • kbinfo kbshell kbregistry kbkernbase KB179365