DetailPage-MSS-KB

Microsoft small business knowledge base

Article ID: 179365 - Last Review: November 21, 2006 - Revision: 4.2

This article was previously published under Q179365

SUMMARY

This article explains how the Run, RunOnce, RunServices, RunServicesOnce, and RunOnce\Setup registry keys relate to each other and to the Startup folder. It also describes the order in which these keys are loaded.

The information contained in this article supplements the following article in the Microsoft Knowledge Base:
137367  (http://support.microsoft.com/kb/137367/EN-US/ ) Definition of the RunOnce Keys in the Registry
Please see this article for an explanation of each of these keys.

MORE INFORMATION

Under Microsoft Windows 95, Windows 98, and Windows Millennium Edition (Me) where all keys are supported, the keys are loaded in the following order:
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunServicesOnce

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunServices

<Logon Prompt>

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run

StartUp Folder

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 HKEY_LOCAL_MACHINE\...\Run, HKEY_CURRENT_USER\...\Run, HKEY_CURRENT_USER\...\RunOnce, 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 dependant 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.

NOTES:
  • 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.

REFERENCES

For additional information on the RunOnceEx key, click the article number%2 below to view the article%2 in the Microsoft Knowledge Base:
232487  (http://support.microsoft.com/kb/232487/EN-US/ ) Description of RunOnceEx Registry Key
For additional information, please see the following article in the Microsoft Knowledge Base:
137367  (http://support.microsoft.com/kb/137367/EN-US/ ) Definition of the RunOnce Keys in the Registry

APPLIES TO
  • Microsoft Win32 Application Programming Interface, when used with:
    • Microsoft Windows 95
    • Microsoft Windows 98 Standard Edition
    • Microsoft Windows Millennium Edition
    • Microsoft Windows NT 3.51 Service Pack 5
    • Microsoft Windows NT 4.0
    • Microsoft Windows 2000 Standard Edition
    • the operating system: Microsoft Windows XP
Keywords: 
kbinfo kbshell kbregistry kbkernbase KB179365
Share
Additional support options
Ask The Microsoft Small Business Support Community
Contact Microsoft Small Business Support
Find Microsoft Small Business Support Certified Partner
Find a Microsoft Store For In-Person Small Business Support