views:

451

answers:

1

Possible Duplicate:
Open form before windows login c#

Hey, how do I change the startup list? Basically I have a program that is a computer locking system and when I enter it into the registry to start up when login, it is like the last thing to open, Thanks.

+3  A: 

Which startup list are you using to launch your application?

There are actually quite a few startup lists (see below). The order of application launch within a given list is not configurable (e.g. there is no way to choose which application in the Startup Folder launch first) but, the order in which the startup lists are iterated is fixed (e.g. Applications in the Common Startup Folder will always launch first, before applications in the Startup Folder).

It sounds like you want to launch your application on user login, so listing your application path in the All Users-Run registry key should ensure that it launches fairly soon after logon.

Add a string (REG_SZ) value to the HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run registry key with the path to your application as the data.

(Aside: Background reading on the arcane terminology of the Windows registry)

STARTUP ORDER FOR WINDOWS 9X/ME

  1. config.sys
  2. autoexec.bat
  3. wininit.ini
  4. winstart.bat
  5. system.ini
  6. win.ini
  7. All Users-RunOnce (HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunServicesOnce)
  8. All Users-RunServices (HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunServices)
  9. All Users-RunOnce (HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce)
  10. All Users-Run (HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run)
  11. All Users-RunOnceEx (HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnceEx)
  12. All Users-RunEx (HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunEx)
  13. Current User-RunOnce (HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnce)
  14. Current User-Run (HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run)
  15. Current User-RunOnceEx (HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnceEx)
  16. Current User-RunEx (HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunEx)
  17. Common Startup Folder
  18. Startup Folder

STARTUP ORDER FOR WINDOWS NT4/2000/XP

  1. BootExecute (`HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\BootExecute
  2. Services
  3. User enters a password and logon to the system
  4. UserInit (HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\UserInit)
  5. Shell (HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\Shell)
  6. All Users-RunOnce (HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce)
  7. All Users-Run (HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run)
  8. All Users-RunOnceEx (HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnceEx)
  9. All Users-RunEx (HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunEx)
  10. Current User-RunOnce (HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnce)
  11. Current User-Run (HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run)
  12. Current User-RunOnceEx (HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnceEx)
  13. Current User-RunEx (HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunEx)
  14. Common Startup Folder
  15. Startup Folder

(Source)

Daniel Fortunov
Thank you for your response, I currently have the application starting up with the registry entry, but my application takes ages before it will start up, is there any way in which I can make it one of the first applications starting up?Thanks.
Crazyd22
I don't think so. If you are trying to create something that is truly secure you might need to take a fundamentally different approach. (For example, there may be a way to suppress these AutoRun applications and therefore prevent your app from launching at all.)
Daniel Fortunov
Hmm alright then thanks, you know of any guides that can help me with this?Thanks.
Crazyd22
Not offhand, sorry. The only things I know about in this area are GINA and logon scripts.
Daniel Fortunov