Results 1 to 2 of 2

Thread: Unable to read registry key in Vista...

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2006
    Posts
    170

    Unable to read registry key in Vista...

    I am using the follow code in my app and it works fine in XP however when the app is run on Vista is returns no value, I'm not sure what is wrong...

    Code:
    Dim MISInstallPath As String = ""
    MISInstallPath = My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\Software\MyCompany\MySoftware", "Path", Nothing)
    Thanks

    Simon

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

    Re: Unable to read registry key in Vista...

    I would say it is either because that registry value does not exist or it is because of the new security features in Vista. If you go into your Project properties and click the Application tab, there should be a button labelled View UAC Settings (not sure if this button appears if you are not developing on a Vista machine though..). If you click that then it will take you to the app.manifest file which is where you can change settings that dictate whether or not registry virtualisation is used etc.

    This is what is in the app.manifest file by default:
    <security>
    <requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
    <!-- UAC Manifest Options
    If you want to change the Windows User Account Control level replace the
    requestedExecutionLevel node with one of the following.

    <requestedExecutionLevel level="asInvoker" uiAccess="false" />
    <requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
    <requestedExecutionLevel level="highestAvailable" uiAccess="false" />

    If you want to utilize File and Registry Virtualization for backward
    compatibility then delete the requestedExecutionLevel node.
    -->
    <requestedExecutionLevel level="asInvoker" uiAccess="false" />
    </requestedPrivileges>
    </security>
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

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


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