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?
 
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
 
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 :)
 
Great!

-Josh
 
Back
Top