Syntax and Flags Used for the RunOnceEx and RunEx Keys

ID: Q232509

IMPORTANT: This article contains information about editing the registry. Before you edit the registry, make sure you understand how to restore it if a problem occurs. For information about how to do this, view the "Restoring the Registry" Help topic in Regedit.exe or the "Restoring a Registry Key" Help topic in Regedt32.exe.

The information in this article applies to:


SUMMARY

Windows 98 includes the RunOnceEx and RunEx registry keys for additional functionality. The syntax and format used for these keys is different the RunOnce and Run keys. This article describes the correct syntax to use the RunOnceEx and RunEx keys and the various settings that can be used.


MORE INFORMATION

WARNING: Using Registry Editor incorrectly can cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that problems resulting from the incorrect use of Registry Editor can be solved. Use Registry Editor at your own risk.

For information about how to edit the registry, view the "Changing Keys and Values" Help topic in Registry Editor (Regedit.exe) or the "Add and Delete Information in the Registry" and "Edit Registry Data" Help topics in Regedt32.exe. Note that you should back up the registry before you edit it. If you are running Windows NT, you should also update your Emergency Repair Disk (ERD).

Sample Syntax

Note that text in braces ({}) are strings generated by the user.

The following keys are located in the Local_Machine and/or Current_User hive(s).

SOFTWARE\Microsoft\Windows\CurrentVersion\RunEx
-or-
SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx
Flags = 0x0000000
Title = "{Status Dialog Box Title}"

Depend\
{PlaceHolder1} = "{DLL/OCX Filename}"
{PlaceHolder...} = "{DLL/OCX Filename}"
{SectionPlaceHolder1}\
Default="{SectionName1}"
{Entry1} = "{EntryFormat}"
{Entry...} = "{EntryFormat}"
Depend\
{PlaceHolder1} = "{DLL/OCX Filename}"
{PlaceHolder...} = "{DLL/OCX Filename}"
{SectionPlaceHolder...}\

Definition of Values and Subkeys

Name: Flags
Value Type: DWORD
Value Path: SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\
Description: Contains setting to enable or disable certain functions of the RunEx or RunOnceEx key.

Value Function Function definition
0x00000000 Default All functions are disabled
0x00000001 Delete Delete registry entries after processing them (normally only RunOnceEx)
0x00000002 Wait Causes items to be run synchronously
0x00000004 Check Shell Status Verifies shell is ready to accept OLE commands
0x00000008 No Error Dialogs Error dialog boxes are not displayed
0x00000010 Create Error Log File Create C:\Windows\RunOnceEx.err file if errors occur
0x00000020 Create Execution Log File Create C:\Windows\RunOnceEx.log file with status of commands
0x00000040 No Exception Trapping Does not trap exceptions that occur when registering DLLs
0x00000080 No Status Dialog Status dialog box is not displayed while RunOnceEx runs
0x00000100 Ignore Flags Flags registry key is ignored


These values are additive.

Example

If you want to create an error log and have no status dialog box, you would set Flags = 0x00000090
(0x0000010 + 0x00000080 = 0x00000090)

Name: Title
Value Type: STRING
Value Path: SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx
Description: This value fills in the Status Dialog Box Title

Key Path: SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\Depend
Description: Contains values that point to DLLs that should be kept loaded in memory while all sections of RunOnceEx are being run.

Name: {PlaceHolder1}
Value Type: String
Value Path: SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\Depend
Description: Contains a DLL or OCX file name with or without the path to the file. The text "{PlaceHolder1}" can be any valid registry value name.

Key Path: SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\{SectionPlaceHolder1}\
Description: Contains entries to be run. Sections are run in alphabetical order. The text "{SectionPlaceHolder1}" can be any valid registry key name.

Name: Default
Value Type: STRING
Value Path: SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\{SectionPlaceHolder1}\
Description: The text "{SectionName1}" can be any valid registry value name.

Name: {Entry1}
Value Type: STRING
Value Path: SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\{SectionPlaceHolder1}\
Description: The text "{Entry1}" can be any valid registry value name. This value contains the string that is actually run.
Format: "<DllFileName>|<FunctionName>|<CommandLineArguements>"

Example:

"Line1" = "||my.exe -quiet -url http://www.microsft.com/"
"Line2" = "shdocvw.dll|DllRegisterServer"

Line1 runes the command line "my.exe -quiet -url http://www.microsft.com/" and Line2 runs the DllRegisterServer function in Shdocvw.dll.

Key Path: SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\{SectionPlaceHolder1}\Depend
Description: Contains values that point to DLLs that should be kept loaded in memory while only this particular section of RunOnceEx is being run.

Additional query words:


Keywords          : kbenv win98 
Version           : WINDOWS:
Platform          : WINDOWS 
Issue type        : kbinfo 

Last Reviewed: June 22, 1999