I cant access the local machine subkey with teh registry class. it says I dont have access. Why? it's only like this with the LocalMachine key:confused:
edit: I was trying to add a key to LocalMachine\Software\Microsoft\Windows\CurrentVersion\Run
Printable View
I cant access the local machine subkey with teh registry class. it says I dont have access. Why? it's only like this with the LocalMachine key:confused:
edit: I was trying to add a key to LocalMachine\Software\Microsoft\Windows\CurrentVersion\Run
Post the code you are using.
VB Code:
Imports Microsoft.Win32 Dim sKey As RegistryKey = Registry.LocalMachine.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Run", [color=red]True[/color]) Dim value As String = sKey.GetValue("NoteTracker") sKey.SetValue("NoteTracker", Application.ExecutablePath) sKey.Close()
Make sure you have TRUE in the OpenSubKey because that allows you to edit the values.
hmmm, it's very weird. I was runnign the exact same thing yesterday and I was getting that error. But I dont get the error anymore (even without passing True to the function)
anyways, thanks for the tip, I'll use that :)