Solved

HKLM\ RunOnce does not run until login

Posted on 2004-09-24
11
7,509 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Transaction Monitoring Vs. Real User Monitoring

Synthetic Transaction Monitoring Vs. Real User Monitoring: When To Use Each Approach? In this article, we will discuss two major monitoring approaches: Synthetic Transaction and Real User Monitoring.

Question has a verified solution.

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

Can I legally transfer my OEM version of Windows to another PC?  (AKA - Can I put a new systemboard in my OEM PC?) Few of us are both IT and legal experts but we all have our own views of Microsoft's licensing rules and how they apply.  There are…
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…
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…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…

717 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