borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (determine if the user machine is connected to the Internet)Next Topic (NETWORK DISCONNECTION) New Topic New Poll Post Reply
AndreaVB Forum : Network : Windows Startup
Poster Message
alokpmin
Level: Guest


icon Windows Startup

How to Add program at Startup usin VB Code

[Edited by alokpmin on 08-02-2004 at 08:05 PM GMT]

08-02-2004 at 03:04 PM
| Quote Reply
Goran
Level: Moderator

Registered: 16-05-2002
Posts: 1681
icon Re: Windows Startup

Two ways to do it properly: Creatinh Shortcut of your App in Startup folder or using the registry. There are also another ways to do it (like configuring autoexec.bat or win.ini), but I wouldnt recommend them to you. My recommendation would be using registry. How to do it depends on when you would like your App to start.

If you want it to start when particular user logs, you should then write key to

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run

If you want it to start when windows starts (no matter which user), you should then write key to

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run

There you should create new key

ValueName=YourAppName (this value can be anything)

ValueData=C:\Program Files\YourAppFolder\YourApp.exe (path to your app)

____________________________
If you find the answer helpful, please mark this topic as solved.

08-02-2004 at 06:50 PM
View Profile Send Email to User Show All Posts | Quote Reply
fabulous
Level: VB Guru


Registered: 03-08-2002
Posts: 439
icon Re: Windows Startup

You could also have a look here for code and ideas - http://www.andreavb.com/forum/viewtopic.php?TopicID=2140.

Happy coding.

____________________________
My boss is a Jewish Carpenter (Jesus Christ)


Brain Bench Certified VB.NET Developer

08-02-2004 at 07:30 PM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
alokpmin
Level: Guest

icon Re: Windows Startup

Thanks for the help! Its a nice one

One more thing...

I am using Setup & deployment vizard to create setup. Is it possible to add some program with setup that executes and modifies registry values? Just like any other setup programs we interact regularly...

10-02-2004 at 04:15 PM
| Quote Reply
Goran
Level: Moderator

Registered: 16-05-2002
Posts: 1681
icon Re: Windows Startup

YOu can create a module in your App that will be called first time your app is executed. My sugestion would be: switch to Visual Studio Installer, there you have registry section, where you can add your key, just like you do add folders and files in Windows explorer.

____________________________
If you find the answer helpful, please mark this topic as solved.

10-02-2004 at 04:55 PM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : Network : Windows Startup
Previous Topic (determine if the user machine is connected to the Internet)Next Topic (NETWORK DISCONNECTION) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder