Results 1 to 4 of 4

Thread: Get registry value - x86

  1. #1
    Adagio is offline VB.NET Forum Genius
    .NET Framework
    .NET 2.0 (VS 2005)
    Join Date
    Dec 2005
    Posts
    162
    Reputation
    96

    Question Get registry value - x86

    I have been searching for a way to retrieve the full path for Outlook.exe and have managed to do it like this:

    Code:
     Public Function GetOutlookPath() As String
            Return My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\OUTLOOK.EXE", "Path", Nothing)
        End Function
    On my current computer (Windows 7 64bit) it works just fine. On our Windows Server (also 64bit) it only works when it is building to "any CPU". When I change it to x86 it will return nothing

    Our application needs to be run built as x86 on our 64bit computers to work correctly

    Does anybody have any idea on how to solve this problem?

  2. #2
    Joshdbr is offline VB.NET Forum Genius
    .NET Framework
    .NET 4.0
    Join Date
    Apr 2011
    Location
    Montana, USA
    Posts
    211
    Reputation
    38
    I'm not sure what your issue is, this code works for me on x86:


    Private Function getOutlookPath() As String
    Dim value As String = My.Computer.Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\OUTLOOK.EXE").GetValue("Path", "")
    Return value
    End Function

  3. #3
    Adagio is offline VB.NET Forum Genius
    .NET Framework
    .NET 2.0 (VS 2005)
    Join Date
    Dec 2005
    Posts
    162
    Reputation
    96
    I have found a solution to the problem. On our server we had Office 2010 64bit installed. When installing 32 bit Office it works just fine

  4. #4
    Joshdbr is offline VB.NET Forum Genius
    .NET Framework
    .NET 4.0
    Join Date
    Apr 2011
    Location
    Montana, USA
    Posts
    211
    Reputation
    38
    Great!

    -Josh
    "Trust in the LORD with all your heart and do not lean on your own understanding. In all your ways acknowledge Him, and He will make your paths straight." -Proverbs 3:5-6

Tags for this Thread

Bookmarks

Posting Permissions

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