Meanie Posted February 28, 2003 Posted February 28, 2003 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? Quote
bpayne111 Posted February 28, 2003 Posted February 28, 2003 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 Quote i'm not lazy i'm just resting before i get tired.
Meanie Posted February 28, 2003 Author Posted February 28, 2003 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. Quote
*Gurus* divil Posted February 28, 2003 *Gurus* Posted February 28, 2003 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: Environment.GetFolderPath(Environment.SpecialFolder.Startup) I'm not sure how you'd create a shortcut there using .NET though. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
Meanie Posted February 28, 2003 Author Posted February 28, 2003 :p Hehe, I got the registry sorted out, it's just the shortcut that I want. Quote
TechnoTone Posted February 28, 2003 Posted February 28, 2003 I don't know whether this will help but I used to use it with VB.OLD to create shortcuts.create shortcuts (shelllnk).zip Quote TT (*_*) There are 10 types of people in this world; those that understand binary and those that don't.
bpayne111 Posted February 28, 2003 Posted February 28, 2003 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 Quote i'm not lazy i'm just resting before i get tired.
Meanie Posted March 1, 2003 Author Posted March 1, 2003 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 Quote
jjjamie Posted March 2, 2003 Posted March 2, 2003 Hi Meanie, Did you ever figure out how to create a shortcut using VB.NET? I would sure like to know. Quote
Meanie Posted March 3, 2003 Author Posted March 3, 2003 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. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.