Question Get registry value - x86

Adagio

Well-known member
Joined
Dec 12, 2005
Messages
162
Programming Experience
Beginner
I have been searching for a way to retrieve the full path for Outlook.exe and have managed to do it like this:

VB.NET:
 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?
 

Joshdbr

Well-known member
Joined
Apr 7, 2011
Messages
211
Location
Montana, USA
Programming Experience
5-10
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
 

Adagio

Well-known member
Joined
Dec 12, 2005
Messages
162
Programming Experience
Beginner
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 :)
 

Joshdbr

Well-known member
Joined
Apr 7, 2011
Messages
211
Location
Montana, USA
Programming Experience
5-10
Great!

-Josh
 

Latest posts

Top Bottom