Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27349

I'm new and failing

$
0
0
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.

Viewing all articles
Browse latest Browse all 27349

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>