been looking for couple of months now and tried a few things but they didn't seen to work. I am trying to write vb.net code so that when my program opens the .exe file saves into a specific folder ( system, run ). I have tried:
My.Computer.Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Run", True).SetValue(Application.ProductName, Application.ExecutablePath)
End Sub
and
Dim regKey As Microsoft.Win32.RegistryKeyregKey
regKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Run", True)
regKey.SetValue("YourApplicationName", "YourInstallPath")
regKey.Close()
but they didn't work.
I am trying to do this so I can email my program to my gran ( she's not good with computers ) and she only has to open it once and it will always open on windows boot. Any help would be much appreciated. Thanks.
My.Computer.Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Run", True).SetValue(Application.ProductName, Application.ExecutablePath)
End Sub
and
Dim regKey As Microsoft.Win32.RegistryKeyregKey
regKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Run", True)
regKey.SetValue("YourApplicationName", "YourInstallPath")
regKey.Close()
but they didn't work.
I am trying to do this so I can email my program to my gran ( she's not good with computers ) and she only has to open it once and it will always open on windows boot. Any help would be much appreciated. Thanks.