Shell.GetFolder

string Shell.GetFolder ( 

number Type )

Description

 Returns the path to a common folder on the local system, such as "My Documents" or the user's Startup folder.

Parameters

Type

(number) The folder that you want. Choose from:

CONSTANT

VALUE

DESCRIPTION

SHF_FONTS

20

The path to the user’s font directory (e.g. "C:\Windows\Fonts").

SHF_DESKTOP

16

The path to the user's Desktop directory. On Windows NT/2000/XP/Vista, this is the path from the per-user profile.

SHF_DESKTOP_COMMON

25

The path to the user's Desktop folder. On Windows NT/2000/XP/Vista, this is the path from the All Users profile. On a non-Windows NT system, this will simply be the path to the user's Desktop folder (same as SHF_DESKTOP).

SHF_STARTMENU

11

The path to the user's Start Menu folder. On Windows NT/2000/XP/Vista, this is the path from the per-user profile.

SHF_STARTMENU_COMMON

22

The path to the user's Start Menu folder. On Windows NT/2000/XP/Vista, this is the path from the All Users profile. On a non-Windows NT system, this will simply be the path to the user's Start Menu folder (same as SHF_STARTMENU).

SHF_STARTMENUPROGRAMS

2

The path to the Programs folder in the user's Start menu. On Windows NT/2000/XP/Vista, 98/ME this is the path from the per-user profile.

SHF_STARTMENUPROGRAMS_COMMON

23

The path to the Programs folder in the user's Start menu. On Windows NT/2000/XP/Vista, 98/ME, this is the path from the All Users profile. On Windows 95, this will simply be the path to the Programs folder in the user's Start menu (same as SHF_STARTMENUPROGRAMS).

SHF_STARTUP

7

The path to the user's Startup folder. On Windows NT/2000/XP/Vista, 98 /ME, this is the path from the per-user profile.

SHF_STARTUP_COMMON

24

The path to the user's Startup folder. On Windows NT/2000/XP/Vista, 98/ ME, this is the path from the All Users profile. On Windows 95, this will be the path to the user's Startup folder (same as SHF_STARTUP).

SHF_COMMONFILES

43

The path to the user's Common Files folder. Typically, this is something like C:\Program Files\Common Files.

SHF_PROGRAMFILES

38

The user's Program Files folder. Typically, this is something like C:\Program Files.

SHF_MYDOCUMENTS

5

The path to the user's personal ("My Documents") folder on their system. Usually this is something like "C:\Documents and Settings\YourName\My Documents" on Windows 2000/XP, "C:\My Documents" on Windows 98/ME, and "C:\Users\YourName\Documents" on Windows Vista.

SHF_APPLICATIONDATA

26

The path to the Application Data folder on the user's system. On Windows NT/2000/XP, this is the path from the per-user profile. Typically, this is something like "C:\Documents and Settings\YourName\Application Data." On Windows Vista, this is something like "C:\Users\YourName\AppData\Roaming."

SHF_APPLICATIONDATA_COMMON

35

The path to the Application Data folder on the user's system. On Windows NT/2000/XP/Vista, this is the path from the All Users profile. On a non-Windows NT system, this will be the path to the user's Application Data folder (same as SHF_APPLICATIONDATA)

Returns

(string) The path to the folder on the user's system that was specified in Type. If this action fails, a blank string "" is returned. You can use Application.GetLastError to determine whether this action failed, and why.

See also:  Related Actions