How to execute a program 'once' before the login prompt

  • Thread starter Thread starter David Lampron
  • Start date Start date
D

David Lampron

I need to execute a program ONCE 'with admin rights' before the logon
procedure 'logi prompt'. This program need to be run on the first boot 'no
user interaction'. It will be used to create a bootloader file to acces a
secondary OS 'linux'. The workstation will be ghosted 'image clone' and
deployed to multiple workstation with different hard disk geometry.

Is there any equivalent in Windows 2K/XP for the reg. key ~RunOnceService ?
Any solutions will be greatly appreciated.


Thank you,
 
Try to put that under registry key
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce. Add
new string value with any name. Put your command as value of that key. Might
work.
 
Try to put that under registry key
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce. Add
new string value with any name. Put your command as value of that key. Might
work.
 
I already tried and it don't works. The program need to be runas an
administrator. If I logon as a normal users (not admin)' the program fail to
create the bootloader files. I don't wish to visit each workstation and
login with admin rights .

Order of execution :
-1- HKLM\Software\Microsoft\Windows\CurrentVersion\RunServicesOnce
-2- HKLM\Software\Microsoft\Windows\CurrentVersion\RunServices
-3- [Logon Prompt]
-4- HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnce

"HKLM\Software\Microsoft\Windows\CurrentVersion\RunServices*" keys are not
supported in Windows 2000/XP.

Need to execute my app ONCE with admin rights before step -3-
 
I already tried and it don't works. The program need to be runas an
administrator. If I logon as a normal users (not admin)' the program fail to
create the bootloader files. I don't wish to visit each workstation and
login with admin rights .

Order of execution :
-1- HKLM\Software\Microsoft\Windows\CurrentVersion\RunServicesOnce
-2- HKLM\Software\Microsoft\Windows\CurrentVersion\RunServices
-3- [Logon Prompt]
-4- HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnce

"HKLM\Software\Microsoft\Windows\CurrentVersion\RunServices*" keys are not
supported in Windows 2000/XP.

Need to execute my app ONCE with admin rights before step -3-
 
David Lampron wrote in
I already tried and it don't works. The program need to be runas
an administrator. If I logon as a normal users (not admin)' the
program fail to create the bootloader files. I don't wish to visit
each workstation and login with admin rights .

Order of execution :
-1- HKLM\Software\Microsoft\Windows\CurrentVersion\RunServicesOnce
-2- HKLM\Software\Microsoft\Windows\CurrentVersion\RunServices
-3- [Logon Prompt]
-4- HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnce

"HKLM\Software\Microsoft\Windows\CurrentVersion\RunServices*" keys
are not supported in Windows 2000/XP.

Need to execute my app ONCE with admin rights before step -3-


Try to put that under registry key
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOn
ce. Add new string value with any name. Put your command as value
of that key. Might
work.

I suggest you try
HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Runonce
\
Can't promise it will work, but that key _should_ run it before any
User Winstations are started by logging on.

Please say the results here.
 
David Lampron wrote in
I already tried and it don't works. The program need to be runas
an administrator. If I logon as a normal users (not admin)' the
program fail to create the bootloader files. I don't wish to visit
each workstation and login with admin rights .

Order of execution :
-1- HKLM\Software\Microsoft\Windows\CurrentVersion\RunServicesOnce
-2- HKLM\Software\Microsoft\Windows\CurrentVersion\RunServices
-3- [Logon Prompt]
-4- HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnce

"HKLM\Software\Microsoft\Windows\CurrentVersion\RunServices*" keys
are not supported in Windows 2000/XP.

Need to execute my app ONCE with admin rights before step -3-


Try to put that under registry key
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOn
ce. Add new string value with any name. Put your command as value
of that key. Might
work.

I suggest you try
HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Runonce
\
Can't promise it will work, but that key _should_ run it before any
User Winstations are started by logging on.

Please say the results here.
 
I need to execute a program ONCE 'with admin rights' before the logon
procedure 'logi prompt'. This program need to be run on the first boot 'no
user interaction'. It will be used to create a bootloader file to acces a
secondary OS 'linux'. The workstation will be ghosted 'image clone' and
deployed to multiple workstation with different hard disk geometry.

Is there any equivalent in Windows 2K/XP for the reg. key ~RunOnceService ?
Any solutions will be greatly appreciated.

I do this kind of thing (to distribute patches etc) with a Machine
Login Script written in KiXtart through the Domain Group Policy.
1. Determine whether the job has run before (stored in custom registry
entry)
2. If not, run the job and create the registry key.
3. Reboot if necessary.

Machine Login Scripts are run ander the local SYSTEM account. If the
job needs access to network resources (mine always do), you need to
grant the necessary ACLs to Domain Computers.
 
I need to execute a program ONCE 'with admin rights' before the logon
procedure 'logi prompt'. This program need to be run on the first boot 'no
user interaction'. It will be used to create a bootloader file to acces a
secondary OS 'linux'. The workstation will be ghosted 'image clone' and
deployed to multiple workstation with different hard disk geometry.

Is there any equivalent in Windows 2K/XP for the reg. key ~RunOnceService ?
Any solutions will be greatly appreciated.

I do this kind of thing (to distribute patches etc) with a Machine
Login Script written in KiXtart through the Domain Group Policy.
1. Determine whether the job has run before (stored in custom registry
entry)
2. If not, run the job and create the registry key.
3. Reboot if necessary.

Machine Login Scripts are run ander the local SYSTEM account. If the
job needs access to network resources (mine always do), you need to
grant the necessary ACLs to Domain Computers.
 
Final solution :

All the merits goes to Jerry Honeycutt for his EXCELLENT book : Windows XP
registry guide,
http://www.amazon.com/exec/obidos/tg/stores/detail/-/books/0735617880/002-7541587-2038454 .


-Step
1-----------------------------------------------------------------------

Enable AutoLogon
-------
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]
"DefaultDomainName"="DOMAIN_NAME"
"DefaultUserName"="ADMIN_NAME"
"AutoAdminLogon"="1"
"DefaultPassword"="PASSWORD"
"AutoLogonCount"=dword:00000001
-------

-Step
2------------------------------------------------------------------------

Add the command you would like to run once
-------
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce]
"AddBoot"="c:\\WINNT\\addBoot.cmd"
-------

-Step
3------------------------------------------------------------------------

Add addboot.cmd, reglog.reg, shutdown.exe 'w2k' to the WINDOWS folders

AddBoot.cmd description :
Run command
Reset unwmanted registry value
Reboot | force

----addBoot.cmd----
bootpart 2 C:\linux.bin
regedit /s C:\WINNT\reglog.reg
shutdown 4 FORCE
exit
-------

Remove unwanted key 'value'

----reglog.reg----
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]
"AutoAdminLogon"="0"
"AutoLogonCount"=dword:00000000
"DefaultPassword"=""
-------
 
Final solution :

All the merits goes to Jerry Honeycutt for his EXCELLENT book : Windows XP
registry guide,
http://www.amazon.com/exec/obidos/tg/stores/detail/-/books/0735617880/002-7541587-2038454 .


-Step
1-----------------------------------------------------------------------

Enable AutoLogon
-------
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]
"DefaultDomainName"="DOMAIN_NAME"
"DefaultUserName"="ADMIN_NAME"
"AutoAdminLogon"="1"
"DefaultPassword"="PASSWORD"
"AutoLogonCount"=dword:00000001
-------

-Step
2------------------------------------------------------------------------

Add the command you would like to run once
-------
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce]
"AddBoot"="c:\\WINNT\\addBoot.cmd"
-------

-Step
3------------------------------------------------------------------------

Add addboot.cmd, reglog.reg, shutdown.exe 'w2k' to the WINDOWS folders

AddBoot.cmd description :
Run command
Reset unwmanted registry value
Reboot | force

----addBoot.cmd----
bootpart 2 C:\linux.bin
regedit /s C:\WINNT\reglog.reg
shutdown 4 FORCE
exit
-------

Remove unwanted key 'value'

----reglog.reg----
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]
"AutoAdminLogon"="0"
"AutoLogonCount"=dword:00000000
"DefaultPassword"=""
-------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top