Start a vb.net application on windows startup or load.
Just Copy and Paste Below code in Startup Form.
(Startup Form : From where application start or that form which open/display first while launching application)
Public Sub RunAtStartup(ByVal ApplicationName As String, ByVal ApplicationPath As String)
Dim CU As Microsoft.Win32.RegistryKey = Registry.CurrentUser.CreateSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Run")
With CU
.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Run", True)
.SetValue(ApplicationName, ApplicationPath)
End With
End Sub
Then copy below code to form load event
RunAtStartup(Application.ProductName,Application.ExecutablePath)
No comments:
Post a Comment