PDA

View Full Version : Calling windows shell functions



Rick_Teller
12-03-2008, 03:42 PM
As part of an update I need to create a folder and install a file in a location that varies by Windows version. Specifically, I need to find the folder where applications write shared data. In my application, I determine this location by making a call to SHGetSpecialFolderPath, passing the value CSIDL_COMMON_APPDATA (&H23). This location resolves to different paths on XP and Vista.

My question: Does the TrueUpdate script language provide a way to determine this location directly? Failing that, is there a way to call this windows api function to determine the location?

Ulrich
12-04-2008, 07:15 AM
My question: Does the TrueUpdate script language provide a way to determine this location directly?

Of course it does:

Shell.GetFolder(SHF_APPLICATIONDATA_COMMON);

Ulrich

Rick_Teller
12-04-2008, 10:34 AM
Thanks for the information. Oddly enough, shortly after I posted the original question, I found a session variable that appears to hold exactly the information I need: %ApplicationDataFolderCommon%. Funny what one can find when one looks carefully in the documentation.

Your suggestion is welcome as well, because it shows how to get at other information not present in session variables. I hadn't come across the Shell object. Thanks!