Starting app when computer boots

Meanie

Newcomer
Joined
Jan 4, 2003
Messages
23
I currently have my program loading when my computer boots into windows by setting the path in my registry, but what I want to do is to have an actual shortcut placed in the Startup directory of the Start Bar.

The program has to be able to add and remove this shortcut whenever the user decides to enable or disable the option to start at boot through the program.

Also, the shortcut must only be set to the current user, not all users, since the program allows for multiple users and multiple settings.

Any ideas?
 
Have you looked at the NotifyIcon component? it should be listed in the toolbox in the forms designer view. I'm not totally sure that's what it does but it sounded like it in the overview

give it a shot
 
NotifyIcon components are used when the program is running. I have one set in the system tray when my app is running, and it disappears when the app shuts down. Without the app running it doesn't really do much.

No, what I need is to set a shortcut to start the app on boot without the shortcut affecting other users of the same computer.
 
You could do that with the registry, if you put the key under HKEY_CURRENT_USER. Or, you can get the complete path to the user's startup directory in the start menu using:

Code:
Environment.GetFolderPath(Environment.SpecialFolder.Startup)

I'm not sure how you'd create a shortcut there using .NET though.
 
what do you mean by start the item at boot?
Start/All Programs/ Start menu?

doyou mean adding a file to the startup in code?

you could add it to the start up directory in code very easy
i'm not completely sure as to what you are trying to do though so it may be wrong
 
Yeah, bpayne111, thats what I'm after, but don't worry about it because you've actually managed to inspire me.

I realised the easiest way to retrieve the startup dir was to get it the same way I retrieve the current user's username

Then I realised that was what divil wrote. Sorry, I wasn't paying attention :D

I should now be able to figure it out from now, thouh if I have any more problems I'll be sure to ask
 
Nah, I didn't. The info i did find didn't seem to relate to VB .NET, so I'm hoping someone else will be able to help out here.

I'll keep u posted if I do find out.
 
Back
Top