.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month

Home >> Code Snippets >> System Registery >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

Adding Applications To The Windows Startup

Posted By:Hefin Dsouza       Posted Date: August 11, 2009    Points: 10    Category: System Registery    URL: http://www.dotnetspark.com  

Adding Applications To The Windows Startup

This Code will let you add your Application at Windows startup

Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        My.Computer.Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Run", True).SetValue(Application.ProductName, Application.ExecutablePath)
    End Sub

Be carefull where you place this code.
It should not irritate your users its beter if you have a option to let user set wether he wants to let your application startup.
To Remove the startup Application

My.Computer.Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Run", True).DeleteValue(Application.ProductName)

Hefin Dsouza


Further Readings:


No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend