Adding Applications To The Windows Startup in VB.NET

Posted by Initiotech under Others category on | Views : 3735
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).SetValueApplication.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)

Hope this code comes handy

Regards Hefin Dsouza

Comments or Responses

Login to post response