English 中文(简体)
Change startup order c#
原标题:

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.

最佳回答

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_MACHINESoftwareMicrosoftWindowsCurrentVersionRun 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_MACHINESoftwareMicrosoftWindowsCurrentVersionRunServicesOnce)
  8. All Users-RunServices (HKEY_LOCAL_MACHINESoftwareMicrosoftWindowsCurrentVersionRunServices)
  9. All Users-RunOnce (HKEY_LOCAL_MACHINESoftwareMicrosoftWindowsCurrentVersionRunOnce)
  10. All Users-Run (HKEY_LOCAL_MACHINESoftwareMicrosoftWindowsCurrentVersionRun)
  11. All Users-RunOnceEx (HKEY_LOCAL_MACHINESoftwareMicrosoftWindowsCurrentVersionRunOnceEx)
  12. All Users-RunEx (HKEY_LOCAL_MACHINESoftwareMicrosoftWindowsCurrentVersionRunEx)
  13. Current User-RunOnce (HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionRunOnce)
  14. Current User-Run (HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionRun)
  15. Current User-RunOnceEx (HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionRunOnceEx)
  16. Current User-RunEx (HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionRunEx)
  17. Common Startup Folder
  18. Startup Folder

STARTUP ORDER FOR WINDOWS NT4/2000/XP

  1. BootExecute (`HKLMSYSTEMCurrentControlSetControlSession ManagerBootExecute
  2. Services
  3. User enters a password and logon to the system
  4. UserInit (HKLMSOFTWAREMicrosoftWindows NTCurrentVersionWinlogonUserInit)
  5. Shell (HKLMSOFTWAREMicrosoftWindows NTCurrentVersionWinlogonShell)
  6. All Users-RunOnce (HKEY_LOCAL_MACHINESoftwareMicrosoftWindowsCurrentVersionRunOnce)
  7. All Users-Run (HKEY_LOCAL_MACHINESoftwareMicrosoftWindowsCurrentVersionRun)
  8. All Users-RunOnceEx (HKEY_LOCAL_MACHINESoftwareMicrosoftWindowsCurrentVersionRunOnceEx)
  9. All Users-RunEx (HKEY_LOCAL_MACHINESoftwareMicrosoftWindowsCurrentVersionRunEx)
  10. Current User-RunOnce (HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionRunOnce)
  11. Current User-Run (HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionRun)
  12. Current User-RunOnceEx (HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionRunOnceEx)
  13. Current User-RunEx (HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionRunEx)
  14. Common Startup Folder
  15. Startup Folder

(Source)

问题回答

暂无回答




相关问题
Why running a service as Local System is bad on windows?

I am trying to find out the difference between difference service account types. I tumbled upon this question. The answer was because it has powerful access to local resources, and Network Service ...

Programmatically detect Windows cluster configuration?

Does anyone know how to programatically detect that a Windows server is part of a cluster? Further, is it possible to detect that the server is the active or passive node? [Edit] And detect it from ...

get file icon for Outlook appointment (.msg)

I ve read Get File Icon used by Shell and the other similar posts - and already use SHFileInfo to get the associated icon for any given extension, and that works great. However, Outlook uses ".msg" ...

Identifying idle state on a windows machine

I know about the GetLastInputInfo method but that would only give me the duration since last user input - keyboard or mouse. If a user input was last received 10 minutes ago, that wouldn t mean the ...

Terminating a thread gracefully not using TerminateThread()

My application creates a thread and that runs in the background all the time. I can only terminate the thread manually, not from within the thread callback function. At the moment I am using ...

热门标签