Loading app on start of windows?

jorge

Junior Contributor
Joined
Jul 13, 2003
Messages
239
Location
Belgium
Hey,
How can a load a application when windows start?
But i don't whant to make a link in startup.
anyone???
 
What OS are you trying to work with?
In Win9x you can use msconfig to set a startup program.
In Win2K XP try to make it as a service if you can.
 
there's also a registry key for loading apps at startup - and they won't appear in the startup folder in the start menu.

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
 
You can set it using the RegistryKey class:
Visual Basic:
Dim key As Microsoft.Win32.RegistryKey = Microsoft.Win32.Registry.LocalMachine
'dim RegistryKey class and set it to LocalMachine
key = key.OpenSubKey("Path to the key", True)
'open the sub key
key.SetValue("YourAPP", "PATH") 'create new entry
key.Close() 'close and flush the key
 
this is my path:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
OR do i need a '\' at the end?
 
Dont put this in it:
HKEY_LOCAL_MACHINE\
You already specified it as the LocalMachine here:
Visual Basic:
Dim key As Microsoft.Win32.RegistryKey = Microsoft.Win32.Registry.LocalMachine
 
Omg that is awesome, thanks mutant, you helped me too lol. :p


------------------------------------Edit-------------------------------


Wait wait, the place where you put the application name. Let's say if I wanted to add notepad at startup, would the Application name be:

notepad?
notepad.exe?
NOTEPAD?
ProcessID?

And what if I created an application that is named: notepad?

Would they both startup (the one from system32 and the one I created?)
 
Last edited:
You can call it whatever you want, the name of the key isnt tied to the name of the app. But its good to know what starts up so you should put in some name that can easily identify your app.
 
Back
Top