Platform SDK: Win32 API

The RunServices and RunServicesOnce Keys

During system startup, the SCM starts the applications listed under the following registry keys: RunServices and RunServicesOnce. These keys are located in the following registry locations:

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion

You can use any unique value name for each application. For the value data, use a string that represents the command line the SCM will use to start the application. Following is an example of a RunServices list that contains entries for three applications:

MyApp1="myapp1.exe"
MyApp2="myapp2.exe" param1 param2
MyApp3="c:\mydir\myapp3.exe"

The system deletes values under the key RunServicesOnce after the application starts.

These applications start before the user logs on. Specifically, the applications under HKEY_LOCAL_MACHINE are run before the desktop is created, and the applications under HKEY_CURRENT_USER are run after the desktop is created. In either case, the user is not yet validated, and the applications cannot assume that networking permissions are enabled. Until the user logs on, the application does not have access to network resources that the user has access to.