Link to home
Start Free TrialLog in
Avatar of raygraham
raygrahamFlag for United States of America

asked on

how to run a command once at system start

I'd like to run the following command at system start one time only "wuauclt /detectnow"

I've tried using the following registry modification and it appears to only execute after a user logs onto the workstation.

"[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce]
"updatewsus"="wuauclt /detectnow"

I'd like this to take place at system start immediately after a programmed reboot. I'd like for the command to execute before a user logon occurs. in other words i don't want to have to depend on a user logging on for the command to execute.
ASKER CERTIFIED SOLUTION
Avatar of r-k
r-k

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Sorry guys, but all that is cheesy.  Try registry:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run

Add new String Value and give it a name.  Set value to:

"wuauclt" /detectnow

Let me know if there are any problems.
Avatar of junglerover77
junglerover77

Hi rfportilla, before you say something, please try it on your own computer first, OK?

Try to be responsible.

Regards,
Jungle
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I didn't realize I was being irresponsible.  This is something I've done many times.
One more thing.  If you are running a domain, you can set up group policy to enforce the startup script on all machines without having to create a task on each machine.  Let me know if you need help with any of the steps.
logon script will work at the beginning of a user logon, but the OP seems to want something to run without a user logging in.  I use FireDaemon for this myself, to run a LazyMirror registry backup after each successful startup.
I am specifying a startup script, not a logon script.  They are different.
I think I deserve a split on this.