Results 1 to 4 of 4

Thread: Set and delete registry value

Threaded View

  1. #1

    Thread Starter
    Fanatic Member daimous's Avatar
    Join Date
    Aug 2005
    Posts
    657

    Set and delete registry value

    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                    
                    }
    Last edited by daimous; Oct 26th, 2006 at 05:47 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width