Monday, April 12, 2010

Error in MSDN documentation for ssfPROGRAMFILESx86

There is a documentation error here: (or even header error)

When using ssfPROGRAMFILESx86 with the value of 0x30, it gives the administrative tools path, while with a value of 0x2A gives Program Files X86.

Can be tested with the following vbscript:

Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(PROGRAM_FILES_XEIGHTYSIXWRONG)
Set objFolderItem = objFolder.Self
msgbox ("Wrong Path: 0x30 :"+objFolderItem.Path)  
Set objFolder = objShell.Namespace(PROGRAM_FILES_XEIGHTYSIX)
Set objFolderItem = objFolder.Self
msgbox ("Correct Path: 0x2A : "+objFolderItem.Path)

To get the correct path, just use 0x2a instead of 0x30.