Solved

HKLM\ RunOnce does not run until login

Posted on 2004-09-24
11
7,361 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
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Step by step guide to Clean and Sort your windows registry! Introduction: Always remember: A Clean registry = Better performance = Save your invaluable time In this article we're going to clear our registry manually! Yes, manually! The e…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

789 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