Link to home
Start Free TrialLog in
Avatar of marcmc
marcmc

asked on

Run CMD on boot

Hello, my problem is as follows:

I want to run a CMD after computer's reboot, with no user logged on.
I can't use AT commands or install services.
Is there any Registry Entry that can run a command only when computer starts (and after disappear)?

Thank you,

P.D. I'm an administrator, and the machines are NT 4.0 SP5.
Avatar of jkr
jkr
Flag of Germany image

There's no way to do this before a user logs on. However, ther'es a workaround

Placing an entry under

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce

Will cause the .cmd file to run when the first user logs on. This has to be sth. like

myentry = "cmd.exe /c c:\path\mycmd.cmd"

where 'myentry' is the value's name...
HKLM/Software/Microsoft/Windows/Current Version/RunOnce.
Avatar of marcmc
marcmc

ASKER

That's the problem. Any user logs on when the computer reboot. I need another way.
What exactly do you need to do ?
What CMD do you need to run ?
SMS / WinInstall would do the trick.
You could use a login script to run at user logon and place a tag file on the system so that it wouldn't run again ?
>>That's the problem. Any user logs on when the computer
>>reboot

This is no problem - it doesn't matter which user logs on, the result will always be the execution of your command file (BTW: That's the way MS recommends to install service packs in unattended setups...)
Avatar of marcmc

ASKER

Sorry, my comment is incorrect. When the computer reboot, no user log into in a few hours, and I want to execute the CMD command immediately.
why cant you run the cmd, as a service ?
You'll have to run the command as a service or use bchew's registry suggestion.
Nither way requires a user logon.
ASKER CERTIFIED SOLUTION
Avatar of fciii
fciii

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