views:

865

answers:

1

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 Adminstrator 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.

+2  A: 

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.

Andrei Belogortseff
But it won't run when runonce runs (before dll's and such get started up).
Kris Erickson
A service can launch a process at any time, it does not depend on any user being logged in. Anyway, we are discussing a solution without a clear understanding of the problem (at least I am). What exactly are you trying to achieve?
Andrei Belogortseff
Is there any way to stop the shell from running until the service has performed its actions?
Kris Erickson