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_MYMUSIC

13

The path to the user's My Music folder. For example "C:\Documents and Settings\User\My Documents\My Music."

SHF_MYMUSIC_COMMON

53

The path to the All Users profile My Music folder, for example "C:\Documents and Settings\All Users\Documents\My Music." Only available on Windows XP/Vista or later.

SHF_MYPICTURES

39

The path to the user's My Pictures folder. For example "C:\Documents and Settings\username\My Documents\My Pictures."

SHF_MYPICTURES_COMMON

54

The path to the All User profile My Pictures folder, for example "C:\Documents and Settings\All Users\Documents\My Pictures." Only available on Windows XP/Vista or later.

SHF_MYVIDEOS

14

The path to the user's My Videos folder. For example "C:\Documents and Settings\username\My Documents\My Videos." Only available on Windows XP/Vista or later.

SHF_MYVIDEOS_COMMON

55

The path to the All User profile My Videos folder. For example "C:\Documents and Settings\All Users\Documents\My Videos." Only available on Windows XP/Vista or later.

SHF_DESKTOP

16

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

SHF_DESKTOP_COMMON

25

The path to the user's Desktop folder. On XP/Vista or later, this is the path from the All Users profile.

SHF_STARTMENU

11

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

SHF_STARTMENU_COMMON

22

The path to the user's Start Menu folder. On Windows XP/Vista or later, this is the path from the All Users profile.

SHF_STARTMENUPROGRAMS

2

The path to the Programs folder in the user's Start menu. On Windows XP/Vista or later 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 XP/Vista or later this is the path from the All Users profile.

SHF_STARTUP

7

The path to the user's Startup folder. On Windows XP/Vista or later this is the path from the per-user profile.

SHF_STARTUP_COMMON

24

The path to the user's Startup folder. On XP/Vista or later this is the path from the All Users profile.

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 XP, and "C:\Users\YourName\Documents" on Windows Vista or later.

SHF_COMMON_DOCUMENTS

46

The path to the documents folder common to all users. Usually this is something like "C:\Documents and Settings\All Users\Documents."

SHF_APPLICATIONDATA

26

The path to the Application Data folder on the user's system. On Windows 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 or later, this is something like "C:\Users\YourName\AppData\Roaming."

SHF_APPLICATIONDATA_LOCAL

28

The path to the local (nonroaming) Application Data folder on the user's system. On Windows XP, this is the path from the per-user profile. Typically, this is something like "C:\Documents and Settings\YourName\Local Settings\Application Data." On Windows Vista or later, this is something like "C:\Users\YourName\AppData\Local."

SHF_APPLICATIONDATA_COMMON

35

The path to the Application Data folder on the user's system. On Windows XP/Vista or later, this is the path from the All Users profile.

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