PDA

View Full Version : CSIDL for Public folder



CaseyR
06-01-2010, 03:07 PM
Hi,

The data for my app is going to be accessed from different workstations, so for the initial VISTA and Win7 installations I would like to have the default data folder as the 'Public' folder. I can't find the relevant CSIDL anywhere. Is there one? If not, how do I get that info into a data folder variable without hardcoding 'C:\Users\Public\MyAppData'.

Any suggestions greatly appreciated.

linder
06-02-2010, 12:18 AM
Casey,

There isn't a CSIDL value for the 'Public' folder. But the environment variable PUBLIC points to it, so you can use Get System Info(Expand Environment Variable) to determine its location.

For example:

Set Variable %PUBLIC_FOLDER% to FUNCTION:Get System Info(Expand Environment Variable) for "PUBLIC"

By default, this variable returns C:\Users\Public in Windows Vista and Windows 7. Please note that the variable does NOT exist in Windows XP, so your code must handle the case where Get System Info(Expand Environment Variable) returns a blank value.

Friedrich

CaseyR
06-03-2010, 04:57 PM
Thanks very much, Friedrich. Exactly what I was looking for. Sorry for the delayed acknowledgement.