special folders

Ken Ray kray at sonsothunder.com
Thu Oct 30 16:03:16 EDT 2008

> So, on Windows, I had expected to use the vanilla rev
> specialfolderpath syntax, but it seems to me I may need to use
> CDISLs, or can I just test that absolute paths to the appropriate
> folder exist as expected?
> I had hoped to use C:documents and settings\all users\documents but
> this doesn't exist on Vista.

When you use specialFolderPath("documents") on Windows, you get different
paths depending on which OS it is...

On XP, you get:

  C:/Documents and Settings/Ken/My Documents

On Vista, you get:


> I can see that for XP most program data is stored in C:documents and
> settings\all users\application data
> In Vista, this exists as a virtualised folder/shortcut which
> redirects to C:programdata

Right - in both cases, you can use specialFolderPath(35) and it will resolve
properly on both platforms.

Tiemo is right though - on both Vista and XP, the Application Data (or
ProgramData) folder is a hidden folder that novice users won't have changed.

The general rule of thumb is:

  - Applications go into "C:/Program Files" (XP) or "C:/Programs" (Vista);
accessed with "specialFolderPath(38)"

  - Support files for the application that the user won't be getting access
to go in "C:/Documents and Settings/<user>/Application Data" (XP) or
"C:/Users/<user>/AppData/Roaming" (Vista); accessed with

  - User-generated or user-accessible files go in "C:/Documents and
Settings/<user>/My Documents" (XP) or "C:/Users/<user>/Documents" (Vista);
accessed with "specialFolderPath("documents") or "specialFolderPath(5)"

  - Preferences/settings go in the Registry


Ken Ray
Sons of Thunder Software, Inc.
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/

More information about the Use-livecode mailing list