Link to home
Start Free TrialLog in
Avatar of stephanjenner
stephanjenner

asked on

HKLM\ RunOnce does not run until login

I have enter the command c:\firstrun.cmd into the HKLM\Software\Microsoft\Windows\CurrectVersion\Runonce key and the program only runs after loggin in I want it to run before login any ideas
Avatar of Longbow
Longbow

If these are 16 bit (dos) programs you can run them from autoexec.nt (see the Windows Resource Kit)
If these are 32 bits you can make a service with them :
http://www.firedaemon.com/
Avatar of merowinger
the programs under runonce will only run one time, are you sure you want these key???

mero
stephanjenner,

You can start an application at the services loading phase before logon by adding it to the registry at HKEY_LOCAL_MACHINE\SYSTEM\CurretnCOntrolSet|Control\Session Manager\BootExecute

The default entry is autocheck autocheck *

Autocheck is the boot time version of Chkdsk, the wildcard * causes an automatic check of each partition.

Before editing the registry, make sure you have a current Emergency Repair Disk for your system and that you have backed up the registry files.

JohnT
Hi,

i suggest you to use "Application as service"

it has the following abilities:

- Launch any application as Windows NT/2000/XP/2003 service
- Launch your application at system boot, before user logon
- Runs executable: 16 bit (Dos, Windows, OS/2), 32 bit, batch files, scripts (VBScript, JScript) as a service
- Run your application without the need of a user session
... and more , visit their URL and take a glance:

http://www.eltima.com/products/application-as-service/
Avatar of stephanjenner

ASKER

I do need to run this just once it is a script to add the machine to the domain so runonce is perfect for me the bootexec will that run .cmd files and will it have network access at this time also whats the format

Cheers
Why to run it before login ?
Do you use this script after cloning the computer ?
In this case use AutoAdminLogon and run the script from RunOnce.
For security reason you can encrypt the script.

If it is your case you can give these details in the original question.
Because we can give other solutions.
Yes I ru n the script after cloning to add the computer to the domain there is 2 parts to the script one is firstrun.cmd which executes joindomain.vbs the vbs grads the computer name and then joins the domain usining netdom. then firstrun.cmd deletes the scipt leaving no passwords etc behind. I could run an auto login I guess then delete the registry key as well as the script? Any other ideas.

ASKER CERTIFIED SOLUTION
Avatar of Longbow
Longbow

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
Thanks excellent advice will utilize it
Thanks. I know ;-)

If you are not hear the computer wich is cloned you can add some lines to disable the keyboard and mouse from the script.
For some reason (network problem) the script can stops and a user can have access to your script.
You can know a vbe script can be decoded.
But that's for another question.