R – How to get runonce to run, without having to have an administrator login

installationregistryrunoncewindows-services

Is there any way to force an update of software using RunOnce, without having an administrator log in, if there is a service running as Administrator running in the background?

EDIT: The main thing I want to be able to do is Run when the RunOnce does, I.E. before Explorer starts. I need to be able to install things, without booting into the Administrator account.

Best Solution

I'm not sure I understand the question. Let me try:

The service you mention, is it yours? If so, you can add code to it to imitate Windows: from your service, examine the RunOnce value and launch the executable it specifies. You can use the CreateProcessAsUser() API to launch it in the context of an arbitrary user. After launching the process, delete the RunOnce entry.

Or have I misunderstood your question?

EDIT: A service does not depend on any user being logged in. You can start your update process from the service as soon as the service itself starts, it will happen before any real user logs in to the computer.

Related Question