Solved

HKLM\ RunOnce does not run until login

Posted on 2004-09-24
11
7,221 Views
Last Modified: 2010-05-18
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
0
Comment
Question by:stephanjenner
11 Comments
 
LVL 10

Expert Comment

by:Longbow
ID: 12141031
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/
0
 
LVL 31

Expert Comment

by:merowinger
ID: 12141327
the programs under runonce will only run one time, are you sure you want these key???

mero
0
 
LVL 6

Expert Comment

by:jthow
ID: 12141411
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
0
 
LVL 4

Expert Comment

by:beem4n
ID: 12142608
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/
0
 

Author Comment

by:stephanjenner
ID: 12144158
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
0
Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

 
LVL 10

Expert Comment

by:Longbow
ID: 12146417
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.
0
 
LVL 10

Expert Comment

by:Longbow
ID: 12146968
Here is a thread about the suggest you post here :
http://www.experts-exchange.com/Operating_Systems/WinNT/Q_20458875.html
0
 

Author Comment

by:stephanjenner
ID: 12148421
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.

0
 
LVL 10

Accepted Solution

by:
Longbow earned 250 total points
ID: 12148585
I can suggest to run the vbs script from HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce
or from the Startup directory in the profile.
The last line of the script can be a "delete" command
 or a line wich delete the key in the registry.

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\WinLogon
Add/Modify these keys :
AutoAdminLogon=1
DefaultPassword=AdminPassword
DefaultUserName=AnAdminAccount

You can encrypt your .vbs file.
It will become a .vbe
So do not forget to change any instance .vbs to .vbe in your script.
Script Encoder Link :
http://www.microsoft.com/downloads/details.aspx?FamilyId=E7877F67-C447-4873-B1B0-21F0626A6329&displaylang=en

I created a .vbe with at least thousand lines.
Each ghosted PC can send me a mail before it shutdown.
So i know the subject ;-)
0
 

Author Comment

by:stephanjenner
ID: 12149514
Thanks excellent advice will utilize it
0
 
LVL 10

Expert Comment

by:Longbow
ID: 12149798
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.
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Issue: Unstable cursor in Windows XP and Windows runs extremely slow in that any click will bring up the Hour glass (sometimes for several seconds before giving you what you want) . Troubleshooting Process and the FINAL FIX: This issue see…
When you start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup". After a while, you have entered a loop for Auto repair which does not fix anything and you will be in a  panic as all your work w…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now