Results 1 to 4 of 4

Thread: Create Registry Key Default Value

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 2001
    Posts
    53

    Create Registry Key Default Value

    Ok, there is something I am missing here. I'm creating a registry key in my installation project for the install path. This works great... except that I need my string value name to be the default in the registry. So, if I look in my registry, I have (default) with no value and Path with my value. How do I fill in that (default)?

  2. #2
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,422

    Re: Create Registry Key Default Value

    try this. it changes the default value in the windows calculator section of the registry in vista x64. the method is the same for any default registry value:

    vb Code:
    1. Dim rk As Microsoft.Win32.RegistryKey = Microsoft.Win32.Registry.CurrentUser
    2. Dim regShell As Microsoft.Win32.RegistryKey = rk.OpenSubKey("Software\Microsoft\Calc", True)
    3. regShell.SetValue("", your value here)

  3. #3
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: Create Registry Key Default Value

    How do I fill in that (default)?
    You dont. That (Default) value is only there as a legacy thing, you shouldnt ever need to do anything with it. If you want to store something in the registry then create your own value for it, I dont see why you would want to stick it in the default value (which isnt actually named "(default)" - that is just the name that regedit shows you)
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


  4. #4

    Thread Starter
    Member
    Join Date
    Aug 2001
    Posts
    53

    Re: Create Registry Key Default Value

    Paul, thanks so much for replying. That's good info but I was hoping to do it during installation. More ideas or is there not a way? Chris, my company has a program reading app paths from the registry. A great deal of existing app paths only have a default value and nothing else so it's reading the default value. Seems there are a great deal of installs out there that are filling in that default value or default would never have a value. I wanted to make sure my program was following suit with the already existing entries in my registry.

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