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_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce
.
- 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
?
Best Answer
Start Program before User Logon Windows 7
The Run Keys and Search-Order
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