Microsoft Knowledge Base Email Alertz

The Windows Desktop Update component implements the RunOnceEx registry key that provides the functionality described in this article. The Windows Desktop Update component is included with Windows 98 and Windows 2000. You can also install the Windows

Search KbAlertz

Advanced Search

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]











Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks

Article ID: 232509 - Last Review: January 24, 2007 - Revision: 2.6

Syntax for the RunOnceEx Registry Key

System TipThis article applies to a different version of Windows than the one you are using. Content in this article may not be relevant to you. Visit the Windows Vista Solution Center
This article was previously published under Q232509
Notice
This article applies to Windows 2000. Support for Windows 2000 ends on July 13, 2010. The Windows 2000 End-of-Support Solution Center (http://support.microsoft.com/?scid=http%3a%2f%2fsupport.microsoft.com%2fwin2000) is a starting point for planning your migration strategy from Windows 2000. For more information see the Microsoft Support Lifecycle Policy (http://support.microsoft.com/lifecycle/) .

On This Page

SUMMARY

The Windows Desktop Update component implements the RunOnceEx registry key that provides the functionality described in this article. The Windows Desktop Update component is included with Windows 98 and Windows 2000. You can also install the Windows Desktop Update component with Microsoft Internet Explorer 4.0. Note that the syntax and format used for this key is different from the RunOnce key.

MORE INFORMATION

Important This section, method, or task contains steps that tell you how to modify the registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click the following article number to view the article in the Microsoft Knowledge Base:
322756  (http://kbalertz.com/Feedback.aspx?kbNumber=322756/ ) How to back up and restore the registry in Windows

RunOnceEx Sample to Run Notepad

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx
Title = "My Setup Title"
Flags = dword:00000002

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\0001
RunMyApp = "||notepad.exe"

Sample Syntax

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx
Flags = dword:00000000
Title = "Status Dialog Box Title"

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\Depend
0001 = "xxx1"
000X = "xxxx"

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\0001
Entry1 = "MyApp1.exe"
EntryX = "MyApp2.exe"

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\000x
...

Notes

  • "xxx1, xxxx" is a dynamic-link library (DLL) or .ocx file name (such as My.ocx or My.dll).
  • "0001, 000x" are section names. Section names can be alphanumeric.
  • "entry1, entryX" are registry string values that point to a program file to run.

Definition of Values and Subkeys

Flags is a DWORD value located in the RunOnceEx key to enable/disable the following settings.

Collapse this tableExpand this table
ValueFunctionFunction definition
0x00000000DefaultAll functions are disabled
0x00000004Check Shell StatusVerifies the shell is ready to accept OLE commands
0x00000008No Error DialogsError dialog boxes are not displayed
0x00000010Create Error Log FileCreate C:\Windows\RunOnceEx.err file if errors occur
0x00000020Create Execution Log FileCreate a C:\Windows\RunOnceEx.log file with status of commands
0x00000040No Exception TrappingDoes not trap exceptions that occur when registering DLLs
0x00000080No Status DialogStatus dialog box is not displayed while RunOnceEx runs

The values are cumulative. If you want "No Status Dialog" and "Create Error Log File," set Flags to hexadecimal 90 (80 + 10).

Title is a STRING value that you can use to fill in the Status dialog box title.

The HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\Depend registry key contains the .dll files and the .ocx files that should be kept loaded in memory while all sections of RunOnceEx are running.

The HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\000X registry keys contain entries to be run. These sections are run in alphabetical order. Therefore, the ...\RunOnceEx\0001 section is processed before the ...\RunOnceEx\0002 section.

The string values within a ...RunOnceEx\000x section contain the commands that should be run for the section. The format is:
"DllFileName|FunctionName|CommandLineArguements"

-or-

"||command parameters"

For example:
"Line1" = "||my.exe -quiet -url http://www.microsoft.com"
"Line2" = "shdocvw.dll|DllRegisterServer"
Line1 runs the "my.exe -quiet -url http://www.microsoft.com" command line. Line2 runs the DllRegisterServer function in Shdocvw.dll.

The HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\000x\Depend registry key contains the .dll files and the .ocx files that should be kept in memory while section 000x is running.

APPLIES TO
  • Microsoft Windows 2000 Server
  • Microsoft Windows 2000 Advanced Server
  • Microsoft Windows 2000 Professional Edition
  • Microsoft Windows 98 Standard Edition
  • Microsoft Windows Millennium Edition
Keywords: 
kbenv kbinfo KB232509
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate