Skip to main content
Decreased code indentation, clarified omitted code and removed fully qualified name (due to import).
Source Link
Visual Vincent
  • 18.4k
  • 5
  • 33
  • 83

A simple method

Imports Microsoft.Win32  ... Dim regKey As Microsoft.Win32.RegistryKey  regKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Run",True)  regKey.SetValue(Application.ProductName, Application.ExecutablePath)  regKey.Close() 

HopHope it helps

A simple method

Imports Microsoft.Win32  Dim regKey As Microsoft.Win32.RegistryKey  regKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Run",True)  regKey.SetValue(Application.ProductName, Application.ExecutablePath)  regKey.Close() 

Hop it helps

A simple method

Imports Microsoft.Win32 ... Dim regKey As RegistryKey regKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Run",True) regKey.SetValue(Application.ProductName, Application.ExecutablePath) regKey.Close() 

Hope it helps

Source Link
Nirav
  • 21
  • 1

A simple method

Imports Microsoft.Win32 Dim regKey As Microsoft.Win32.RegistryKey regKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Run",True) regKey.SetValue(Application.ProductName, Application.ExecutablePath) regKey.Close() 

Hop it helps