Previous Topic: GetShortFileName - Convert Long File Name to Short File NameNext Topic: Is_Archive - Check if the File is Archived


GetSpecialDir - Get the Special Directory Name and Path

Valid on Windows and Windows CE

The GetSpecialDir function gets the name and path of special directories.

Function format:

GetSpecialDir(Id as integer, Path as string) as integer
Id

The identifier of the special directory.

Path

Drive and path name of the specified directory (Output parameter).

On successful completion, the function returns zero (0); otherwise, it returns a non-zero value.

Note: If the location specified by the CSIDL parameter is not part of the file system, this function fails.

Example:

Rem sample for special directories

Dim dirName As String
ClrScr()

If GetSpecialDir(CSIDL_APPDATA, dirName) <> 0 Then
	MsgBox("Retrieve CSIDL_APPDATA failed!", "DMS", MB_OK + MB_ICONEXCLAMATION)
	SetStatus(1)
	Exit
End If

Print("CSIDL_APPDATA: """ + dirName + """")