Where is the RunServicesOnce registry key
I have an application that updates software on the local machine. I need the software to be updated prior to user log on, and have read that running the application via the RunServicesOnce
registry key is probably the most appropriate to use for this purpose.
But I can't find this key using regedit
and it doesn't appear in the same location as the HKLM RunOnce key in HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionRunOnce
.
- Where is this key located? Same in Windows XP Vista 7 8 8.1 10 ?
- How do I use it, are there any optional parameters?
- How do I determine the user that the application is run as? Is it run by the user that created the key? If a
LocalSystem
service creates the key, will it be run asLocalSystem
?
windows windows-registry
|
show 1 more comment
I have an application that updates software on the local machine. I need the software to be updated prior to user log on, and have read that running the application via the RunServicesOnce
registry key is probably the most appropriate to use for this purpose.
But I can't find this key using regedit
and it doesn't appear in the same location as the HKLM RunOnce key in HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionRunOnce
.
- Where is this key located? Same in Windows XP Vista 7 8 8.1 10 ?
- How do I use it, are there any optional parameters?
- How do I determine the user that the application is run as? Is it run by the user that created the key? If a
LocalSystem
service creates the key, will it be run asLocalSystem
?
windows windows-registry
Same location in every version of Windows
– Ramhound
Jan 29 '16 at 2:57
@Ramhound thanks for your help - where in that document does it specify the location of the RunServicesOnce key?
– khargoosh
Jan 29 '16 at 2:59
Wrong...Support article....should have linked to this
– Ramhound
Jan 29 '16 at 3:00
More talk
– Ramhound
Jan 29 '16 at 3:03
1
@Ramhound your second link clearly states that it applies to "Windows 95, Windows 98, and Windows Millennium Edition"
– Yisroel Tech
Jan 29 '16 at 4:18
|
show 1 more comment
I have an application that updates software on the local machine. I need the software to be updated prior to user log on, and have read that running the application via the RunServicesOnce
registry key is probably the most appropriate to use for this purpose.
But I can't find this key using regedit
and it doesn't appear in the same location as the HKLM RunOnce key in HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionRunOnce
.
- Where is this key located? Same in Windows XP Vista 7 8 8.1 10 ?
- How do I use it, are there any optional parameters?
- How do I determine the user that the application is run as? Is it run by the user that created the key? If a
LocalSystem
service creates the key, will it be run asLocalSystem
?
windows windows-registry
I have an application that updates software on the local machine. I need the software to be updated prior to user log on, and have read that running the application via the RunServicesOnce
registry key is probably the most appropriate to use for this purpose.
But I can't find this key using regedit
and it doesn't appear in the same location as the HKLM RunOnce key in HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionRunOnce
.
- Where is this key located? Same in Windows XP Vista 7 8 8.1 10 ?
- How do I use it, are there any optional parameters?
- How do I determine the user that the application is run as? Is it run by the user that created the key? If a
LocalSystem
service creates the key, will it be run asLocalSystem
?
windows windows-registry
windows windows-registry
asked Jan 29 '16 at 2:44
khargooshkhargoosh
13118
13118
Same location in every version of Windows
– Ramhound
Jan 29 '16 at 2:57
@Ramhound thanks for your help - where in that document does it specify the location of the RunServicesOnce key?
– khargoosh
Jan 29 '16 at 2:59
Wrong...Support article....should have linked to this
– Ramhound
Jan 29 '16 at 3:00
More talk
– Ramhound
Jan 29 '16 at 3:03
1
@Ramhound your second link clearly states that it applies to "Windows 95, Windows 98, and Windows Millennium Edition"
– Yisroel Tech
Jan 29 '16 at 4:18
|
show 1 more comment
Same location in every version of Windows
– Ramhound
Jan 29 '16 at 2:57
@Ramhound thanks for your help - where in that document does it specify the location of the RunServicesOnce key?
– khargoosh
Jan 29 '16 at 2:59
Wrong...Support article....should have linked to this
– Ramhound
Jan 29 '16 at 3:00
More talk
– Ramhound
Jan 29 '16 at 3:03
1
@Ramhound your second link clearly states that it applies to "Windows 95, Windows 98, and Windows Millennium Edition"
– Yisroel Tech
Jan 29 '16 at 4:18
Same location in every version of Windows
– Ramhound
Jan 29 '16 at 2:57
Same location in every version of Windows
– Ramhound
Jan 29 '16 at 2:57
@Ramhound thanks for your help - where in that document does it specify the location of the RunServicesOnce key?
– khargoosh
Jan 29 '16 at 2:59
@Ramhound thanks for your help - where in that document does it specify the location of the RunServicesOnce key?
– khargoosh
Jan 29 '16 at 2:59
Wrong...Support article....should have linked to this
– Ramhound
Jan 29 '16 at 3:00
Wrong...Support article....should have linked to this
– Ramhound
Jan 29 '16 at 3:00
More talk
– Ramhound
Jan 29 '16 at 3:03
More talk
– Ramhound
Jan 29 '16 at 3:03
1
1
@Ramhound your second link clearly states that it applies to "Windows 95, Windows 98, and Windows Millennium Edition"
– Yisroel Tech
Jan 29 '16 at 4:18
@Ramhound your second link clearly states that it applies to "Windows 95, Windows 98, and Windows Millennium Edition"
– Yisroel Tech
Jan 29 '16 at 4:18
|
show 1 more comment
1 Answer
1
active
oldest
votes
Where is the RunServicesOnce registry key
I have an application that updates software on the local machine. I
need the software to be updated prior to user log on
Start Program before User Logon Windows 7
If you want it to start before the user logs on, you will have to
start it as a service. Here is the startup sequence of the major
registry keys, starting immediately after bootmgr has been read and
ending with the program shortcut entries in the two Startup folders.
- HKLMSYSTEMCurrentControlSetControlSession ManagerBootExecute. This can include instructions to schedule the running of chkdsk but
not user programs.
- Services start next, followed by the RunServicesOnce and RunServices registry keys (if present)
- User then logs on to the system
- HKLMSOFTWAREMicrosoftWindows NTCurrentVersionWinlogonUserInit. This points to the program
C:WINDOWSsystem32userinit.exe and the entry ends with a comma.
Other programs can be started from this key by appending them and
separating them with a comma.
- HKLMSOFTWAREMicrosoftWindows NTCurrentVersionWinlogonShell. This should contain just one entry, explorer.exe.
- Program entries in these 2 registry keys for ALL USERS start next: HKLMSOFTWAREMicrosoftWindowsCurrentVersionRun and RunOnce
- Program entries in these 2 registry keys for CURRENT USER start next: HKCUSoftwareMicrosoftWindowsCurrentVersionRun and RunOnce
- Programs in the Startup Folders of All Users and Current User are started last of all.
Important programs like antivirus and firewall
start early in the sequence as Services. The icons that appear in the
Notification Area (bottom right of the screen) are just their user
interfaces, i.e. options and preferences.
The additional location
for 32-bit software in a 64-bit computer is HKLMSOFTWAREWow6432Node
and HKCU.
The Run Keys and Search-Order
The registry is accessed even before the NT kernel is loaded, so it is
very important to understand what the computer is configured to load
at startup. The following list of registry keys are accessed during
system start in order of their use by the different windows
components:
- HKLMSYSTEMCurrentControlSetControlSession
ManagerBootExecute
- HKLMSystemCurrentControlSetServices (start value of 0 indicates
kernel drivers, which load before kernel initiation)
- HKLMSystemCurrentControlSetServices (start value of 2, auto-start
and 3, manual start via SCM)
- HKLMSoftwareMicrosoftWindowsCurrentVersionRunServicesOnce
- HKCUSoftwareMicrosoftWindowsCurrentVersionRunServicesOnce
- HKLMSoftwareMicrosoftWindowsCurrentVersionRunServices
- HKCUSoftwareMicrosoftWindowsCurrentVersionRunServices
- HKLMSOFTWAREMicrosoftWindows NTCurrentVersionWinlogonNotify
- HKLMSoftwareMicrosoftWindows NTCurrentVersionWinlogonUserinit
- HKCUSoftwareMicrosoftWindows NTCurrentVersionWinlogonShell
- HKLMSoftwareMicrosoftWindows NTCurrentVersionWinlogonShell
- HKLMSOFTWAREMicrosoftWindowsCurrentVersionShellServiceObjectDelayLoad
- HKLMSoftwareMicrosoftWindowsCurrentVersionRunOnce
- HKLMSoftwareMicrosoftWindowsCurrentVersionRunOnceEx
- HKLMSoftwareMicrosoftWindowsCurrentVersionRun
- HKCUSoftwareMicrosoftWindowsCurrentVersionRun
- HKCUSoftwareMicrosoftWindowsCurrentVersionRunOnce
- HKLMSoftwareMicrosoftWindowsCurrentVersionPoliciesExplorerRun
- HKCUSoftwareMicrosoftWindowsCurrentVersionPoliciesExplorerRun
- HKCUSoftwareMicrosoftWindows NTCurrentVersionWindowsload
- HKLMSoftwareMicrosoftWindows NTCurrentVersionWindows
- HKLMSOFTWAREMicrosoftWindowsCurrentVersionExplorerSharedTaskScheduler
(XP, NT, W2k only)
- HKLMSoftwareMicrosoftWindows
NTCurrentVersionWindowsAppInit_DLLs
Note: Some of these keys are also reflected under
HKLMSoftwarewow6432node on systems running on a 64bit architecture
and with a 64bit version of Windows. I won’t be covering each of these
in this post.
Run your service as the LocalSystem account unless the account needs to access network resources at which point you'd create a domain service account, give it access to the applicable resources, and then hard-code its credentials for the service to run as. On the local machine, it'll have administrative permissions to everything and not require any password for the service credential.
LocalSystem Account
The LocalSystem account is a predefined local account used by the
service control manager. This account is not recognized by the
security subsystem, so you cannot specify its name in a call to the
LookupAccountName function. It has extensive privileges on the local
computer, and acts as the computer on the network. Its token includes
the NT AUTHORITYSYSTEM and BUILTINAdministrators SIDs; these
accounts have access to most system objects. The name of the account
in all locales is .LocalSystem. The name, LocalSystem or
ComputerNameLocalSystem can also be used. This account does not have
a password. If you specify the LocalSystem account in a call to the
CreateService or ChangeServiceConfig function, any password
information you provide is ignored.
1
"If you want it to start before the user logs on, you will have to start it as a service." How aboutschtasks
instead?
– mirh
Mar 26 '17 at 15:47
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1032828%2fwhere-is-the-runservicesonce-registry-key%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Where is the RunServicesOnce registry key
I have an application that updates software on the local machine. I
need the software to be updated prior to user log on
Start Program before User Logon Windows 7
If you want it to start before the user logs on, you will have to
start it as a service. Here is the startup sequence of the major
registry keys, starting immediately after bootmgr has been read and
ending with the program shortcut entries in the two Startup folders.
- HKLMSYSTEMCurrentControlSetControlSession ManagerBootExecute. This can include instructions to schedule the running of chkdsk but
not user programs.
- Services start next, followed by the RunServicesOnce and RunServices registry keys (if present)
- User then logs on to the system
- HKLMSOFTWAREMicrosoftWindows NTCurrentVersionWinlogonUserInit. This points to the program
C:WINDOWSsystem32userinit.exe and the entry ends with a comma.
Other programs can be started from this key by appending them and
separating them with a comma.
- HKLMSOFTWAREMicrosoftWindows NTCurrentVersionWinlogonShell. This should contain just one entry, explorer.exe.
- Program entries in these 2 registry keys for ALL USERS start next: HKLMSOFTWAREMicrosoftWindowsCurrentVersionRun and RunOnce
- Program entries in these 2 registry keys for CURRENT USER start next: HKCUSoftwareMicrosoftWindowsCurrentVersionRun and RunOnce
- Programs in the Startup Folders of All Users and Current User are started last of all.
Important programs like antivirus and firewall
start early in the sequence as Services. The icons that appear in the
Notification Area (bottom right of the screen) are just their user
interfaces, i.e. options and preferences.
The additional location
for 32-bit software in a 64-bit computer is HKLMSOFTWAREWow6432Node
and HKCU.
The Run Keys and Search-Order
The registry is accessed even before the NT kernel is loaded, so it is
very important to understand what the computer is configured to load
at startup. The following list of registry keys are accessed during
system start in order of their use by the different windows
components:
- HKLMSYSTEMCurrentControlSetControlSession
ManagerBootExecute
- HKLMSystemCurrentControlSetServices (start value of 0 indicates
kernel drivers, which load before kernel initiation)
- HKLMSystemCurrentControlSetServices (start value of 2, auto-start
and 3, manual start via SCM)
- HKLMSoftwareMicrosoftWindowsCurrentVersionRunServicesOnce
- HKCUSoftwareMicrosoftWindowsCurrentVersionRunServicesOnce
- HKLMSoftwareMicrosoftWindowsCurrentVersionRunServices
- HKCUSoftwareMicrosoftWindowsCurrentVersionRunServices
- HKLMSOFTWAREMicrosoftWindows NTCurrentVersionWinlogonNotify
- HKLMSoftwareMicrosoftWindows NTCurrentVersionWinlogonUserinit
- HKCUSoftwareMicrosoftWindows NTCurrentVersionWinlogonShell
- HKLMSoftwareMicrosoftWindows NTCurrentVersionWinlogonShell
- HKLMSOFTWAREMicrosoftWindowsCurrentVersionShellServiceObjectDelayLoad
- HKLMSoftwareMicrosoftWindowsCurrentVersionRunOnce
- HKLMSoftwareMicrosoftWindowsCurrentVersionRunOnceEx
- HKLMSoftwareMicrosoftWindowsCurrentVersionRun
- HKCUSoftwareMicrosoftWindowsCurrentVersionRun
- HKCUSoftwareMicrosoftWindowsCurrentVersionRunOnce
- HKLMSoftwareMicrosoftWindowsCurrentVersionPoliciesExplorerRun
- HKCUSoftwareMicrosoftWindowsCurrentVersionPoliciesExplorerRun
- HKCUSoftwareMicrosoftWindows NTCurrentVersionWindowsload
- HKLMSoftwareMicrosoftWindows NTCurrentVersionWindows
- HKLMSOFTWAREMicrosoftWindowsCurrentVersionExplorerSharedTaskScheduler
(XP, NT, W2k only)
- HKLMSoftwareMicrosoftWindows
NTCurrentVersionWindowsAppInit_DLLs
Note: Some of these keys are also reflected under
HKLMSoftwarewow6432node on systems running on a 64bit architecture
and with a 64bit version of Windows. I won’t be covering each of these
in this post.
Run your service as the LocalSystem account unless the account needs to access network resources at which point you'd create a domain service account, give it access to the applicable resources, and then hard-code its credentials for the service to run as. On the local machine, it'll have administrative permissions to everything and not require any password for the service credential.
LocalSystem Account
The LocalSystem account is a predefined local account used by the
service control manager. This account is not recognized by the
security subsystem, so you cannot specify its name in a call to the
LookupAccountName function. It has extensive privileges on the local
computer, and acts as the computer on the network. Its token includes
the NT AUTHORITYSYSTEM and BUILTINAdministrators SIDs; these
accounts have access to most system objects. The name of the account
in all locales is .LocalSystem. The name, LocalSystem or
ComputerNameLocalSystem can also be used. This account does not have
a password. If you specify the LocalSystem account in a call to the
CreateService or ChangeServiceConfig function, any password
information you provide is ignored.
1
"If you want it to start before the user logs on, you will have to start it as a service." How aboutschtasks
instead?
– mirh
Mar 26 '17 at 15:47
add a comment |
Where is the RunServicesOnce registry key
I have an application that updates software on the local machine. I
need the software to be updated prior to user log on
Start Program before User Logon Windows 7
If you want it to start before the user logs on, you will have to
start it as a service. Here is the startup sequence of the major
registry keys, starting immediately after bootmgr has been read and
ending with the program shortcut entries in the two Startup folders.
- HKLMSYSTEMCurrentControlSetControlSession ManagerBootExecute. This can include instructions to schedule the running of chkdsk but
not user programs.
- Services start next, followed by the RunServicesOnce and RunServices registry keys (if present)
- User then logs on to the system
- HKLMSOFTWAREMicrosoftWindows NTCurrentVersionWinlogonUserInit. This points to the program
C:WINDOWSsystem32userinit.exe and the entry ends with a comma.
Other programs can be started from this key by appending them and
separating them with a comma.
- HKLMSOFTWAREMicrosoftWindows NTCurrentVersionWinlogonShell. This should contain just one entry, explorer.exe.
- Program entries in these 2 registry keys for ALL USERS start next: HKLMSOFTWAREMicrosoftWindowsCurrentVersionRun and RunOnce
- Program entries in these 2 registry keys for CURRENT USER start next: HKCUSoftwareMicrosoftWindowsCurrentVersionRun and RunOnce
- Programs in the Startup Folders of All Users and Current User are started last of all.
Important programs like antivirus and firewall
start early in the sequence as Services. The icons that appear in the
Notification Area (bottom right of the screen) are just their user
interfaces, i.e. options and preferences.
The additional location
for 32-bit software in a 64-bit computer is HKLMSOFTWAREWow6432Node
and HKCU.
The Run Keys and Search-Order
The registry is accessed even before the NT kernel is loaded, so it is
very important to understand what the computer is configured to load
at startup. The following list of registry keys are accessed during
system start in order of their use by the different windows
components:
- HKLMSYSTEMCurrentControlSetControlSession
ManagerBootExecute
- HKLMSystemCurrentControlSetServices (start value of 0 indicates
kernel drivers, which load before kernel initiation)
- HKLMSystemCurrentControlSetServices (start value of 2, auto-start
and 3, manual start via SCM)
- HKLMSoftwareMicrosoftWindowsCurrentVersionRunServicesOnce
- HKCUSoftwareMicrosoftWindowsCurrentVersionRunServicesOnce
- HKLMSoftwareMicrosoftWindowsCurrentVersionRunServices
- HKCUSoftwareMicrosoftWindowsCurrentVersionRunServices
- HKLMSOFTWAREMicrosoftWindows NTCurrentVersionWinlogonNotify
- HKLMSoftwareMicrosoftWindows NTCurrentVersionWinlogonUserinit
- HKCUSoftwareMicrosoftWindows NTCurrentVersionWinlogonShell
- HKLMSoftwareMicrosoftWindows NTCurrentVersionWinlogonShell
- HKLMSOFTWAREMicrosoftWindowsCurrentVersionShellServiceObjectDelayLoad
- HKLMSoftwareMicrosoftWindowsCurrentVersionRunOnce
- HKLMSoftwareMicrosoftWindowsCurrentVersionRunOnceEx
- HKLMSoftwareMicrosoftWindowsCurrentVersionRun
- HKCUSoftwareMicrosoftWindowsCurrentVersionRun
- HKCUSoftwareMicrosoftWindowsCurrentVersionRunOnce
- HKLMSoftwareMicrosoftWindowsCurrentVersionPoliciesExplorerRun
- HKCUSoftwareMicrosoftWindowsCurrentVersionPoliciesExplorerRun
- HKCUSoftwareMicrosoftWindows NTCurrentVersionWindowsload
- HKLMSoftwareMicrosoftWindows NTCurrentVersionWindows
- HKLMSOFTWAREMicrosoftWindowsCurrentVersionExplorerSharedTaskScheduler
(XP, NT, W2k only)
- HKLMSoftwareMicrosoftWindows
NTCurrentVersionWindowsAppInit_DLLs
Note: Some of these keys are also reflected under
HKLMSoftwarewow6432node on systems running on a 64bit architecture
and with a 64bit version of Windows. I won’t be covering each of these
in this post.
Run your service as the LocalSystem account unless the account needs to access network resources at which point you'd create a domain service account, give it access to the applicable resources, and then hard-code its credentials for the service to run as. On the local machine, it'll have administrative permissions to everything and not require any password for the service credential.
LocalSystem Account
The LocalSystem account is a predefined local account used by the
service control manager. This account is not recognized by the
security subsystem, so you cannot specify its name in a call to the
LookupAccountName function. It has extensive privileges on the local
computer, and acts as the computer on the network. Its token includes
the NT AUTHORITYSYSTEM and BUILTINAdministrators SIDs; these
accounts have access to most system objects. The name of the account
in all locales is .LocalSystem. The name, LocalSystem or
ComputerNameLocalSystem can also be used. This account does not have
a password. If you specify the LocalSystem account in a call to the
CreateService or ChangeServiceConfig function, any password
information you provide is ignored.
1
"If you want it to start before the user logs on, you will have to start it as a service." How aboutschtasks
instead?
– mirh
Mar 26 '17 at 15:47
add a comment |
Where is the RunServicesOnce registry key
I have an application that updates software on the local machine. I
need the software to be updated prior to user log on
Start Program before User Logon Windows 7
If you want it to start before the user logs on, you will have to
start it as a service. Here is the startup sequence of the major
registry keys, starting immediately after bootmgr has been read and
ending with the program shortcut entries in the two Startup folders.
- HKLMSYSTEMCurrentControlSetControlSession ManagerBootExecute. This can include instructions to schedule the running of chkdsk but
not user programs.
- Services start next, followed by the RunServicesOnce and RunServices registry keys (if present)
- User then logs on to the system
- HKLMSOFTWAREMicrosoftWindows NTCurrentVersionWinlogonUserInit. This points to the program
C:WINDOWSsystem32userinit.exe and the entry ends with a comma.
Other programs can be started from this key by appending them and
separating them with a comma.
- HKLMSOFTWAREMicrosoftWindows NTCurrentVersionWinlogonShell. This should contain just one entry, explorer.exe.
- Program entries in these 2 registry keys for ALL USERS start next: HKLMSOFTWAREMicrosoftWindowsCurrentVersionRun and RunOnce
- Program entries in these 2 registry keys for CURRENT USER start next: HKCUSoftwareMicrosoftWindowsCurrentVersionRun and RunOnce
- Programs in the Startup Folders of All Users and Current User are started last of all.
Important programs like antivirus and firewall
start early in the sequence as Services. The icons that appear in the
Notification Area (bottom right of the screen) are just their user
interfaces, i.e. options and preferences.
The additional location
for 32-bit software in a 64-bit computer is HKLMSOFTWAREWow6432Node
and HKCU.
The Run Keys and Search-Order
The registry is accessed even before the NT kernel is loaded, so it is
very important to understand what the computer is configured to load
at startup. The following list of registry keys are accessed during
system start in order of their use by the different windows
components:
- HKLMSYSTEMCurrentControlSetControlSession
ManagerBootExecute
- HKLMSystemCurrentControlSetServices (start value of 0 indicates
kernel drivers, which load before kernel initiation)
- HKLMSystemCurrentControlSetServices (start value of 2, auto-start
and 3, manual start via SCM)
- HKLMSoftwareMicrosoftWindowsCurrentVersionRunServicesOnce
- HKCUSoftwareMicrosoftWindowsCurrentVersionRunServicesOnce
- HKLMSoftwareMicrosoftWindowsCurrentVersionRunServices
- HKCUSoftwareMicrosoftWindowsCurrentVersionRunServices
- HKLMSOFTWAREMicrosoftWindows NTCurrentVersionWinlogonNotify
- HKLMSoftwareMicrosoftWindows NTCurrentVersionWinlogonUserinit
- HKCUSoftwareMicrosoftWindows NTCurrentVersionWinlogonShell
- HKLMSoftwareMicrosoftWindows NTCurrentVersionWinlogonShell
- HKLMSOFTWAREMicrosoftWindowsCurrentVersionShellServiceObjectDelayLoad
- HKLMSoftwareMicrosoftWindowsCurrentVersionRunOnce
- HKLMSoftwareMicrosoftWindowsCurrentVersionRunOnceEx
- HKLMSoftwareMicrosoftWindowsCurrentVersionRun
- HKCUSoftwareMicrosoftWindowsCurrentVersionRun
- HKCUSoftwareMicrosoftWindowsCurrentVersionRunOnce
- HKLMSoftwareMicrosoftWindowsCurrentVersionPoliciesExplorerRun
- HKCUSoftwareMicrosoftWindowsCurrentVersionPoliciesExplorerRun
- HKCUSoftwareMicrosoftWindows NTCurrentVersionWindowsload
- HKLMSoftwareMicrosoftWindows NTCurrentVersionWindows
- HKLMSOFTWAREMicrosoftWindowsCurrentVersionExplorerSharedTaskScheduler
(XP, NT, W2k only)
- HKLMSoftwareMicrosoftWindows
NTCurrentVersionWindowsAppInit_DLLs
Note: Some of these keys are also reflected under
HKLMSoftwarewow6432node on systems running on a 64bit architecture
and with a 64bit version of Windows. I won’t be covering each of these
in this post.
Run your service as the LocalSystem account unless the account needs to access network resources at which point you'd create a domain service account, give it access to the applicable resources, and then hard-code its credentials for the service to run as. On the local machine, it'll have administrative permissions to everything and not require any password for the service credential.
LocalSystem Account
The LocalSystem account is a predefined local account used by the
service control manager. This account is not recognized by the
security subsystem, so you cannot specify its name in a call to the
LookupAccountName function. It has extensive privileges on the local
computer, and acts as the computer on the network. Its token includes
the NT AUTHORITYSYSTEM and BUILTINAdministrators SIDs; these
accounts have access to most system objects. The name of the account
in all locales is .LocalSystem. The name, LocalSystem or
ComputerNameLocalSystem can also be used. This account does not have
a password. If you specify the LocalSystem account in a call to the
CreateService or ChangeServiceConfig function, any password
information you provide is ignored.
Where is the RunServicesOnce registry key
I have an application that updates software on the local machine. I
need the software to be updated prior to user log on
Start Program before User Logon Windows 7
If you want it to start before the user logs on, you will have to
start it as a service. Here is the startup sequence of the major
registry keys, starting immediately after bootmgr has been read and
ending with the program shortcut entries in the two Startup folders.
- HKLMSYSTEMCurrentControlSetControlSession ManagerBootExecute. This can include instructions to schedule the running of chkdsk but
not user programs.
- Services start next, followed by the RunServicesOnce and RunServices registry keys (if present)
- User then logs on to the system
- HKLMSOFTWAREMicrosoftWindows NTCurrentVersionWinlogonUserInit. This points to the program
C:WINDOWSsystem32userinit.exe and the entry ends with a comma.
Other programs can be started from this key by appending them and
separating them with a comma.
- HKLMSOFTWAREMicrosoftWindows NTCurrentVersionWinlogonShell. This should contain just one entry, explorer.exe.
- Program entries in these 2 registry keys for ALL USERS start next: HKLMSOFTWAREMicrosoftWindowsCurrentVersionRun and RunOnce
- Program entries in these 2 registry keys for CURRENT USER start next: HKCUSoftwareMicrosoftWindowsCurrentVersionRun and RunOnce
- Programs in the Startup Folders of All Users and Current User are started last of all.
Important programs like antivirus and firewall
start early in the sequence as Services. The icons that appear in the
Notification Area (bottom right of the screen) are just their user
interfaces, i.e. options and preferences.
The additional location
for 32-bit software in a 64-bit computer is HKLMSOFTWAREWow6432Node
and HKCU.
The Run Keys and Search-Order
The registry is accessed even before the NT kernel is loaded, so it is
very important to understand what the computer is configured to load
at startup. The following list of registry keys are accessed during
system start in order of their use by the different windows
components:
- HKLMSYSTEMCurrentControlSetControlSession
ManagerBootExecute
- HKLMSystemCurrentControlSetServices (start value of 0 indicates
kernel drivers, which load before kernel initiation)
- HKLMSystemCurrentControlSetServices (start value of 2, auto-start
and 3, manual start via SCM)
- HKLMSoftwareMicrosoftWindowsCurrentVersionRunServicesOnce
- HKCUSoftwareMicrosoftWindowsCurrentVersionRunServicesOnce
- HKLMSoftwareMicrosoftWindowsCurrentVersionRunServices
- HKCUSoftwareMicrosoftWindowsCurrentVersionRunServices
- HKLMSOFTWAREMicrosoftWindows NTCurrentVersionWinlogonNotify
- HKLMSoftwareMicrosoftWindows NTCurrentVersionWinlogonUserinit
- HKCUSoftwareMicrosoftWindows NTCurrentVersionWinlogonShell
- HKLMSoftwareMicrosoftWindows NTCurrentVersionWinlogonShell
- HKLMSOFTWAREMicrosoftWindowsCurrentVersionShellServiceObjectDelayLoad
- HKLMSoftwareMicrosoftWindowsCurrentVersionRunOnce
- HKLMSoftwareMicrosoftWindowsCurrentVersionRunOnceEx
- HKLMSoftwareMicrosoftWindowsCurrentVersionRun
- HKCUSoftwareMicrosoftWindowsCurrentVersionRun
- HKCUSoftwareMicrosoftWindowsCurrentVersionRunOnce
- HKLMSoftwareMicrosoftWindowsCurrentVersionPoliciesExplorerRun
- HKCUSoftwareMicrosoftWindowsCurrentVersionPoliciesExplorerRun
- HKCUSoftwareMicrosoftWindows NTCurrentVersionWindowsload
- HKLMSoftwareMicrosoftWindows NTCurrentVersionWindows
- HKLMSOFTWAREMicrosoftWindowsCurrentVersionExplorerSharedTaskScheduler
(XP, NT, W2k only)
- HKLMSoftwareMicrosoftWindows
NTCurrentVersionWindowsAppInit_DLLs
Note: Some of these keys are also reflected under
HKLMSoftwarewow6432node on systems running on a 64bit architecture
and with a 64bit version of Windows. I won’t be covering each of these
in this post.
Run your service as the LocalSystem account unless the account needs to access network resources at which point you'd create a domain service account, give it access to the applicable resources, and then hard-code its credentials for the service to run as. On the local machine, it'll have administrative permissions to everything and not require any password for the service credential.
LocalSystem Account
The LocalSystem account is a predefined local account used by the
service control manager. This account is not recognized by the
security subsystem, so you cannot specify its name in a call to the
LookupAccountName function. It has extensive privileges on the local
computer, and acts as the computer on the network. Its token includes
the NT AUTHORITYSYSTEM and BUILTINAdministrators SIDs; these
accounts have access to most system objects. The name of the account
in all locales is .LocalSystem. The name, LocalSystem or
ComputerNameLocalSystem can also be used. This account does not have
a password. If you specify the LocalSystem account in a call to the
CreateService or ChangeServiceConfig function, any password
information you provide is ignored.
answered Jan 29 '16 at 6:11
Pimp Juice ITPimp Juice IT
25k114177
25k114177
1
"If you want it to start before the user logs on, you will have to start it as a service." How aboutschtasks
instead?
– mirh
Mar 26 '17 at 15:47
add a comment |
1
"If you want it to start before the user logs on, you will have to start it as a service." How aboutschtasks
instead?
– mirh
Mar 26 '17 at 15:47
1
1
"If you want it to start before the user logs on, you will have to start it as a service." How about
schtasks
instead?– mirh
Mar 26 '17 at 15:47
"If you want it to start before the user logs on, you will have to start it as a service." How about
schtasks
instead?– mirh
Mar 26 '17 at 15:47
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1032828%2fwhere-is-the-runservicesonce-registry-key%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Same location in every version of Windows
– Ramhound
Jan 29 '16 at 2:57
@Ramhound thanks for your help - where in that document does it specify the location of the RunServicesOnce key?
– khargoosh
Jan 29 '16 at 2:59
Wrong...Support article....should have linked to this
– Ramhound
Jan 29 '16 at 3:00
More talk
– Ramhound
Jan 29 '16 at 3:03
1
@Ramhound your second link clearly states that it applies to "Windows 95, Windows 98, and Windows Millennium Edition"
– Yisroel Tech
Jan 29 '16 at 4:18