$shpath function


The $shpath function returns the shell path represented by either the CSIDL csidl (a unique identifier used by the Windows shell for special folder locations) or by the KNOWNFOLDERID knownfolderid (a new style symbolic folder GUID introduced with Windows Vista). If called without parameters, the result is the Desktop path; if csidl or knownfolderid refers to a non-existing folder, the result is an empty string.



All parameters may contain symbolic references; these are resolved before the function is applied. See Examples below.

CSIDL of the desired folder. The CSIDL values are defined by Windows; note that not all Windows versions support all CSIDL values. You can use either decimal or hexadecimal values for the csidl parameter, but you can not use the symbolic name. For a list of CSIDL values, see the topic CSIDL values.
KNOWNFOLDERID of the desired folder. This must be a GUID in the format {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}; the actual values are defined by Windows. Note that folder path lookup by KNOWNFOLDERID was introduced in Windows Vista; older versions of Windows do not support this format and will always return an empty path. For a list of KNOWNFOLDERIDs, see the topic KNOWNFOLDERID values.


Here are some usage examples for this function:

Returns C:\Windows\resources on a Windows system that supports CSIDL_RESOURCES; returns an empty path on older systems.
Same as previous, using hexadecimal notation.
On Windows Vista and later, returns the path to the user's Documents folder using the FOLDERID_Documents GUID value. On earlier versions of Windows, returns an empty path.