Definition of the RunOnce Keys in the Registry

This article was previously published under Q137367
This article has been archived. It is offered "as is" and will no longer be updated.
For a Microsoft Windows XP version of this article, see 314866.
There are seven Run keys in the registry that cause programs to be runautomatically:
  • HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run
  • HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run
  • HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce
  • HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnce
  • HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\ RunServices
  • HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\ RunServicesOnce
  • HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\ RunOnce\Setup
Keys 1 through 7 apply to Windows 95, Windows 98, Windows 98 Second Edition, and Windows Millennium Edition (Me).

Keys 1 through 4 also apply to Windows NT 4.0 and Windows 2000.

For Windows 98, Windows 98 Second Edition, Windows Me, Windows NT 4.0 SP3 or later, and Windows 2000, an additional rule is available; for keys 3 and 4, the value name can be prefixed with an asterisk to force the program to run even in Safe mode.

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

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

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

Under each of these keys is a series of values. The values are used toallow multiple subentries to exist without overwriting one another.

The data value for a value is a command line. By default, Run keys areignored in Safe mode. For keys 3 and 4, the value name can be prefixed withan exclamation point to defer deletion of the value until after thecommand has been completed.

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

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

Article ID: 137367 - Last Review: 12/04/2015 12:04:40 - Revision: 2.3

Microsoft Windows 2000 Server, Microsoft Windows 2000 Advanced Server, Microsoft Windows 2000 Professional Edition, Microsoft Windows 95, Microsoft Windows 98 Standard Edition, Microsoft Windows 98 Second Edition, Microsoft Windows Millennium Edition, Microsoft Windows NT Server 4.0 Standard Edition, Microsoft Windows NT Workstation 4.0 Developer Edition

  • kbnosurvey kbarchive kbenv kbinfo KB137367