|
-
Nov 2nd, 2005, 06:48 PM
#1
Thread Starter
Hyperactive Member
[RESOLVED] knows how to make a VB automatically start up immediately right after XP
Does anyone knows how to make a VB project (already compiled and published) to automatically start up immediately right after XP has finish its start up sequence (has boot up already)
Thanks
-
Nov 2nd, 2005, 07:20 PM
#2
Thread Starter
Hyperactive Member
Re: knows how to make a VB automatically start up immediately right after XP
I mean in code without putting a shortcut in the "Startup" menu.
-
Nov 2nd, 2005, 07:38 PM
#3
Re: knows how to make a VB automatically start up immediately right after XP
You can't. If your app is not running then it can't do anything, including start itself. You need to either put a shortcut in the Startup folder or add an entry to the Run section of the registry. Your app can do either of these things in code so that on future boots it will be started automatically. The only other option would be to write a service that itself starts automatically and then it starts your app, but why do such a convoluted thing?
-
Nov 2nd, 2005, 07:41 PM
#4
Thread Starter
Hyperactive Member
Re: knows how to make a VB automatically start up immediately right after XP
or add an entry to the Run section of the registry. Your app can do this in code
I like this very much, is the code to do this too complicated?
-
Nov 2nd, 2005, 08:00 PM
#5
Re: knows how to make a VB automatically start up immediately right after XP
VB Code:
Microsoft.Win32.Registry.LocalMachine.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Run", True).SetValue(Application.ProductName, Application.ExecutablePath)
Note that this will cause the current application to be run on subsequent boots for all users. if you want it to apply to just the current user you would substitute CurrentUser for LocalMachine. Also note that this will use the value that you have set for AssemblyProduct in the AssemblyInfo.vb as the name of the value in the registry. You can use another name if you like but this is the logical choice. If you haven't set that value in the AssemblyInfo.vb file then I suggest you remedy that situation for every project you are working on, whether you want to store it in the registry or not.
-
Nov 2nd, 2005, 08:04 PM
#6
Thread Starter
Hyperactive Member
Re: knows how to make a VB automatically start up immediately right after XP
-
Nov 2nd, 2005, 08:13 PM
#7
Re: knows how to make a VB automatically start up immediately right after XP
You think I'm holding something back? That single line of code will create a value with the specified name under the HKLM\Software\Microsoft\Windows\CurrentVersion\Run key if it does not exist and set it to the fully qualified path to your executable. Each time the system boots Windows checks that key and executes each of the commandlines it finds.
-
Nov 2nd, 2005, 08:17 PM
#8
Thread Starter
Hyperactive Member
Re: knows how to make a VB automatically start up immediately right after XP
Thanks you are awesome!!!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|