The question:
My program has an option for running at startup.
I need a way to add a registry key to:
HKEY_Current_User\Software\Microsoft\Windows\CurrentVersion\Run\
And Remove it as well.
I've looked in to some other stuff but it seems way to complicated for what i need.
The accepted answer by Moayad Mardini:
To add a value to that key :
My.Computer.Registry.SetValue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run", YourProgramName, YourProgramPath, Microsoft.Win32.RegistryValueKind.String)
Then to delete it :
My.Computer.Registry.CurrentUser.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Run", True).DeleteValue(YourProgramName)
Hope this helps
0 comments:
Post a Comment