Definition of the RunOnce Keys in the Registry

Last reviewed: November 21, 1996
Article ID: Q137367
The information in this article applies to:
  • Microsoft Windows 95

SUMMARY

There are seven Run keys in the registry that cause programs to be run automatically:

  1. HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run

  2. HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run

  3. HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce

  4. HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnce

  5. HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\ RunServices

  6. HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\ RunServicesOnce

  7. HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\ RunOnce\Setup

MORE INFORMATION

Keys 1-4 are run each time a new user logs in.

Keys 5-6 are run in the background when the logon dialog box first appears, or at this stage of the boot process if there is no logon. These keys are for background services such as remote registry service and are run only once per boot.

Key 7 is run as part of Setup's first-boot activities, or after you use the Add/Remove Programs Wizard.

Under each of these keys is a series of subkeys. The subkeys are used to allow multiple sub-entries to exist without overwriting one another.

The value for a subkey is a command line. By default, Run keys are ignored in Safe mode. For keys 3-4, the command line can be prefixed with an exclamation point to defer deletion of the subkey until after the command has been completed.

For keys 3, 4, and 6, the subkey is deleted before the command line is run unless overridden as noted above. As a result, if a RunOnce operation fails to run properly, the component that failed will not be asked to run again the next time you start the computer.

Key 7 is used only by Setup. This key displays the progress dialog box as the keys are run one at a time. For key 7, the name of the subkey is the name that is displayed in the dialog box.


KBCategory: kbsetup
KBSubcategory: win95
Additional reference words: 95


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: November 21, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.