i've got a program i wrote in win xp that changes a registry value
vb.net Code:
Public regShell As RegistryKey Public regKey As RegistryKey = Registry.LocalMachine '' set startup options If RunToolStripMenuItem.Checked = False Then RunToolStripMenuItem.Checked = True regShell = regKey.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Run", True) regShell.SetValue("screen capture", Application.ExecutablePath) Else RunToolStripMenuItem.Checked = False regShell = regKey.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Run", True) regShell.SetValue("screen capture", "<NonRun>") End If
this worked well in win xp, but now i've upgraded to vista, it causes an error:
'attempted to perform an unauthorised operation'
how can i rewrite this so it doesn't cause this error?
thanks


Reply With Quote