hi guys i have a code below to set a registry value, though im not sure if it is the right way to make my application run automatically when windows start, but i dont have yet a code that will delete the that value i've set. i've tried the Registry.LocalMachine.DeleteValue but it didn't work.
Code:if (chkEnableOnStartup.Checked) { Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", Application.ProductName.ToString(), Application.ExecutablePath.ToString()); } else { //Code to delete value here }




Reply With Quote