Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: ShortcutDir IntControl 92 File Redirection 64 x64 64-bit
ShortcutDir(35, 0, @TRUE)... returns an empty string, while the command...
ShortcutDir("Common AppData", 0, @TRUE)... returns the expected C:\ProgramData\ folder name.
The second form is a workaround, but it would be nice if the first form would work as well.
The ShortCutDir function dynamically loads the Windows Shell DLL but the load fails because IntControl 92 forces WinBatch to attempt to load the 64-bit Shell DLL. And as we all know, you can't load a 64-bit DLL into a 32-bit process.
The only reason it appears to work at all is because ShortCutDir has some old fall-back Windows 95 code that happens to work for a few short cuts some of the time. MSFT considers the old Windows 95 technique deprecated (and a mistake) but we haven't got around to removing it for ShortCutDir yet.
Also note that this is not a Windows 7 issue but a 64-bit Windows issue.
Simply put, don't disable file redirection before calling ShortCutDir.
Article ID: W17650
Filename: ShortcutDir IntControl 92.txt
File Created: 2010:09:08:12:12:38
Last Updated: 2010:09:08:12:12:38