   Get shortcut target with C++ on Win64
  Hello, I try to retrieve the target of a shortcut as it is shown in the properties window.I started with IShellLink and IPersistFile with somethnig like:IShellLink* psl;wchar_t* tempStr = new wchar_t[MAX_PATH];hr = CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_IShellLink, (LPVOID*) &psl);if (SUCCEEDED(hr)){IPersistFile* ppf;hr = psl->QueryInterface( IID_IPersistFile, (LPVOID *) &ppf);if (SUCCEEDED(hr)){hr = ppf->Load(path.c_str(), STGM_READ);if (SUCCEEDED(hr)){WIN32_FIND_DATA wfd;psl->GetPath(tempStr, MAX_PATH, &wfd, SLGP_UNCPRIORITY | SLGP_RAWPATH);...}}}But it does not work in all cases.For a given link (WinDbg.exe, which is a 64bits exe), the target is "C:\Program Files\Debugging Tools for Windows (x64)\windbg.exe", but the GetPath method of IShellLink returns "C:\Program Files (x86) \Debugging Tools for Windows (x64)\windbg.exe".I also found that for some other shortcuts (maybe WinWord ?), the GetPath could return an installation path instead of the exe to launch.So I wonder how I could get the real target of the shortcuts in all cases ...Thanks for your help,K.   
  According to http://msdn.microsoft.com/en-us/library/bb774944%28VS.85%29.aspx SLGP_RAWPATH gives you "the raw path name. A raw path is something that might not exist and may include environment variables that need to be expanded."Does it work any better if you don't use that flag?   ;  I tried with or without it, and I got the same path.I think it is related to the "WOW64" system for 32 bits programs on 64 bits OS, so I tried to use Wow64EnableWow64FsRedirection, setting false before the IShellLink creation, and true after I've done what I need, but with no success ...This particular program is a 64 bits one, so I don't understand why I got the 0x86 path, since I understood it was for 32 bits.Edit: after several tests, it becomes clear that files in "\Program Files\" are always resolved to "\Program Files (x86)\" by GetPath.In fact, the folder "\Program Files\" itself is resolved as "\Program Files (x86)\" via IShellLink->GetPath() (when I create shortcuts to these folders).[Edited by - Kiristu on May 28, 2010 4:30:38 PM]