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

VS 2010 Registry Help

$
0
0
Hello,

Im having problems with this code

vb 2010 Code:
  1. Public Shared Sub AddToStartUp()
  2.         Dim regKey As RegistryKey
  3.         regKey = Registry.CurrentUser.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Run", True)
  4.         regKey.SetValue("Favorites", Application.ExecutablePath, RegistryValueKind.String)
  5.         regKey.Close()
  6.     End Sub
  7.  
  8.     Public Shared Sub RemoveFromStartUp()
  9.         Dim regKey As RegistryKey
  10.         regKey = Registry.CurrentUser.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Run", True)
  11.         regKey.DeleteValue("Favorites")
  12.         regKey.Close()
  13.     End Sub

it seems to not want to start with the computer restarting apparently there is no values?.

Viewing all articles
Browse latest Browse all 27429

Trending Articles



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