- Home
·
- Registry
·
- This code will run your VB (Visual Basic) application on windows startup. Autorun on windows startu
This code will run your VB (Visual Basic) application on windows startup. Autorun on windows startu
This code will run your VB (Visual Basic) application on windows startup. Autorun on windows startup
Rate This code will run your VB (Visual Basic) application on windows startup. Autorun on windows startu
(2(2 Vote))
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim regKey As Microsoft.Win32.RegistryKey
Dim KeyName As String = "MySampleApplication"
Dim KeyValue As String = "C:\test\test.exe"
regKey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Run", True)
If regKey.GetValue(KeyName) = Nothing Then
'if there's no KeyName yet? then create and set it's value
MsgBox("No Program of this name found..!")
regKey.SetValue(KeyName, KeyValue, Microsoft.Win32.RegistryValueKind.String)
MsgBox("key " & KeyName & " has been created")
End If
End Sub
End Class
This code will run your VB (Visual Basic) application on windows startup. Autorun on windows startu Comments
No comments yet — be the first to post one!
Post a Comment