Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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?

Posted

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

i'm not lazy i'm just resting before i get tired.
Posted

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.

  • *Gurus*
Posted

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.

MVP, Visual Developer - .NET

 

Now you see why evil will always triumph - because good is dumb.

 

My free .NET Windows Forms Controls and Articles

Posted

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

i'm not lazy i'm just resting before i get tired.
Posted

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

Posted

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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...