Article ID: 281820 - Last Review: February 12, 2007 - Revision: 1.2 INFO: Specifying RunOnce in Device INF FilesThis article was previously published under Q281820 SUMMARY
You typically use RunOnce entries to open applications one-time only, either when a system startup occurs or when a user logs on, depending on where the RunOnce entry is added in the registry.
For additional information, click the article number below
to view the article in the Microsoft Knowledge Base:
137367
(http://support.microsoft.com/kb/137367/EN-US/
)
Definition of the RunOnce Keys in the Registry
You can use RunOnce entries in device INF files to invoke external code to run after an installation completes. This article discusses the limitations of using RunOnce in device INF files.
MORE INFORMATION
If you use RunOnce entries in an INF file to invoke external code after an installation completes, you must restrict the usage to calling Rundll32.exe to provide a DLL file. This allows the DLLs to run during a server-side installation of a signed INF file. For example:
[DeviceInstall.RunOnce.AddReg] HKLM,%RunOnce%,"Name_Of_The_Entry",,"rundll32.exe Name_Of_The_dll,Entry_Point_In_To_The_DLL Argument1, Argument2,..etc." During a server-side installation of a signed INF file, RunOnce is not invoked directly; rather, the device installer (SetupAPI functions) intercepts the registry entries in the INF file, and then calls the DLL directly as if invoked by the Rundll32.exe file through a RunOnce entry. All RunOnce entries in the registry are run in the following cases:
NOTE: Instead of using RunOnce entries, the preferred way is to use the coinstaller wherever possible. REFERENCESFor additional information, click the article number below
to view the article in the Microsoft Knowledge Base:
158022
(http://support.microsoft.com/kb/158022/EN-US/
)
RunOnce Registry Key Runs Program at Every Startup
| Article Translations
|
Back to the top
