Mr. Mancunian, thanks for the reply.
The Registry link is in HKCU and is: C:\Users\Jeff\AppData\Local\Apps\2.0\D5ZPYN2E.G6B\ 0YHBPWKG.YJD\ab2l..tion_0000000000000000_0001.0000 _bd808c8132a0d2ac\AB2L6WS.exe -hide; while the Desktop shortcut shows no such link (it's a ClickOnce deployment). The shortcut properties are:
Name: AB2L 6-Way Sync.appref-ms
Type: ClickOnce Application Reference
Folder Path: C:\Users\Jeff\Desktop
More info: The settings work fine if I start program by using the startmenu link, Desktop link, or command line in command prompt. Also if I use the Release version .exe (before deployment) with the run key there is no problem. But using the debug .exe or the downloaded version with the run key there is a problem.
In case you want to know, my code to create the reg key is:
- Try
-
Dim regKey As RegistryKey
-
regKey = Registry.CurrentUser.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Run", True)
-
Dim myPath As String = Application.ExecutablePath & " -hide"
-
regKey.SetValue(Process.GetCurrentProcess.ProcessName, myPath)
-
Catch
-
End Try
I've already checked to see if it had anything to do with the " -hide" (which hides the form by defining " -hide" in the form load event) by taking it out, but I get the same result.
I'm wondering if it has something to do with ClickOnce, but I don't know.
Curious to see what you might think. Thanks again.