Storages & Files GetSpecialPath
GetSpecialPath method 

Returns the full path name of special standard path on the PC.

Syntax:

variable = object.GetSpecialPath(pathID)

Parameters:

PathID - a constant for the special path (see also the ASP include files). It can be one of the following values:

Value Constant Description
-5 cGSPCommonFiles Common Files directory - usually a subdirectory of Program Files directory. Common DLL should be installed there.
-4 cGSPProgramFiles Program Files directory. Usually the applications are installed in its subdirectories.
-3 cGSPTempPath Temporary folder.
-2 cGSPWinDir Windows directory
-1 cGSPSysPath System directory (system or system32 directory)
2 cGSPPrograms Start menu\Programs
5 cGSPPersonal Personal folder (or MyDocuments on the newer OS versions)
6 cGSPFavorites Favorites directory
7 cGSPStartup Start Menu\Startup
8 cGSPRecent Recent documents directory
9 cGSPSendTo Send To directory
11 cGSPStartMenu Start Menu folder
16 cGSPDesktopDirectory The folder containing the desktop items
20 cGSPFonts Fonts directory
21 cGSPTemplates Templates directory
22 cGSPCommonStartMenu All Users\Start menu*
23 cGSPCommonPrograms All Users\Start Menu\Programs*
24 cGSPCommonStartUp All Users\Start Menu\Start Up*
25 cGSPCommonDesktopDir All Users desktop directory
26 cGSPAPPData Application data directory. Here the applications can create subfolders where they can save their configuration and other data.
31 cGSPCommonFavorites All Users\Favorites*
33 cGSPCookies Cookies directory
34 cGSPHistory History directory

* - on Windows 95/98/ME/CE/CE.NET systems common and user specific folders may overlap depending on the system configuration

Note: Some of the special paths are not available on all the platforms. Please check MSDN for more detailed information. More constants can be used if you are interested see the SHGetSpecialFolderLocation function in MSDN. 

Examples:

Set sf = Server.CreateObject("newObjects.utilctls.SFMain")
Response.Write "Windows directory is: " & sf.GetSpecialPath(-2)

Remarks:

The values returned are usually passed to file open/create methods, to ShellLink object (if shortcuts are to be created/inspected) and any other file manipulation/information routines.

The directories are returned without a trailing "\" character.

Applies to: SFMain object

Supported on:

Windows 95/NT and later
Pocket PC/Windows Mobile 2003 and later
Also available in some special editions for Windows CE/CE.NET

 

newObjects Copyright 2001-2006 newObjects [ ]