Matrix1 Utility Plug-ins

DIR SHELL FOLDER


Syntax

Directory = DIR SHELL FOLDER ( FolderId )

Description

Returns the location of the specified FolderId.

This function takes into account any local system settings that may cause the folder to be in a non-standard location.

The following list can be used to specify which folder is required:
#constant CSIDL_DESKTOP = 0x0000 `
#constant CSIDL_PROGRAMS = 0x0002 ` Start Menu\Programs
#constant CSIDL_PERSONAL = 0x0005 ` My Documents
#constant CSIDL_FAVORITES = 0x0006 ` \Favorites
#constant CSIDL_STARTUP = 0x0007 ` Start Menu\Programs\Startup
#constant CSIDL_RECENT = 0x0008 ` \Recent
#constant CSIDL_SENDTO = 0x0009 ` \SendTo
#constant CSIDL_STARTMENU = 0x000b ` \Start Menu
#constant CSIDL_MYMUSIC = 0x000d ` "My Music" folder
#constant CSIDL_MYVIDEO = 0x000e ` "My Videos" folder
#constant CSIDL_DESKTOPDIRECTORY = 0x0010 ` \Desktop
#constant CSIDL_NETHOOD = 0x0013 ` \nethood
#constant CSIDL_FONTS = 0x0014 ` windows\fonts
#constant CSIDL_TEMPLATES = 0x0015
#constant CSIDL_COMMON_STARTMENU = 0x0016 ` All Users\Start Menu
#constant CSIDL_COMMON_PROGRAMS = 0x0017 ` All Users\Start Menu\Programs
#constant CSIDL_COMMON_STARTUP = 0x0018 ` All Users\Startup
#constant CSIDL_COMMON_DESKTOPDIRECTORY = 0x0019 ` All Users\Desktop
#constant CSIDL_APPDATA = 0x001a ` \Application Data
#constant CSIDL_PRINTHOOD = 0x001b ` \PrintHood
#constant CSIDL_LOCAL_APPDATA = 0x001c ` \Local Settings\Application Data (non roaming)
#constant CSIDL_ALTSTARTUP = 0x001d ` non localized startup
#constant CSIDL_COMMON_ALTSTARTUP = 0x001e ` non localized common startup
#constant CSIDL_COMMON_FAVORITES = 0x001f
#constant CSIDL_INTERNET_CACHE = 0x0020
#constant CSIDL_COOKIES = 0x0021
#constant CSIDL_HISTORY = 0x0022
#constant CSIDL_COMMON_APPDATA = 0x0023 ` All Users\Application Data
#constant CSIDL_WINDOWS = 0x0024 ` GetWindowsDirectory()
#constant CSIDL_SYSTEM = 0x0025 ` GetSystemDirectory()
#constant CSIDL_PROGRAM_FILES = 0x0026 ` C:\Program Files
#constant CSIDL_MYPICTURES = 0x0027 ` C:\Program Files\My Pictures
#constant CSIDL_PROFILE = 0x0028 ` USERPROFILE
#constant CSIDL_SYSTEMX86 = 0x0029 ` x86 system directory on RISC
#constant CSIDL_PROGRAM_FILESX86 = 0x002a ` x86 C:\Program Files on RISC
#constant CSIDL_PROGRAM_FILES_COMMON = 0x002b ` C:\Program Files\Common
#constant CSIDL_PROGRAM_FILES_COMMONX86 = 0x002c ` x86 Program Files\Common on RISC
#constant CSIDL_COMMON_TEMPLATES = 0x002d ` All Users\Templates
#constant CSIDL_COMMON_DOCUMENTS = 0x002e ` All Users\Documents
#constant CSIDL_COMMON_ADMINTOOLS = 0x002f ` All Users\Start Menu\Programs\Administrative Tools
#constant CSIDL_ADMINTOOLS = 0x0030 ` \Start Menu\Programs\Administrative Tools
#constant CSIDL_COMMON_MUSIC = 0x0035 ` All Users\My Music
#constant CSIDL_COMMON_PICTURES = 0x0036 ` All Users\My Pictures
#constant CSIDL_COMMON_VIDEO = 0x0037 ` All Users\My Video
#constant CSIDL_RESOURCES = 0x0038 ` Resource Directory
#constant CSIDL_RESOURCES_LOCALIZED = 0x0039 ` Localized Resource Direcotry
#constant CSIDL_COMMON_OEM_LINKS = 0x003a ` Links to All Users OEM specific apps
#constant CSIDL_CDBURN_AREA = 0x003b ` USERPROFILE\Local Settings\Application Data\Microsoft\CD Burning

The value passed can also contain one of the following modifiers (bitwise or-ed with a folder id):
#constant CSIDL_FLAG_CREATE = 0x8000 ` combine with CSIDL_ value to force folder creation in SHGetFolderPath()
#constant CSIDL_FLAG_DONT_VERIFY = 0x4000 ` combine with CSIDL_ value to return an unverified folder path

If the folder does not exist, and neither of the CREATE or DONT_VERIFY flags are set, the function will return an empty string.
Incorrect values passed as the folder id will result in an empty string being returned, rather than triggering an error.

Go back to ...

Matrix1Util_24 Commands Menu
Matrix1 Utils Main Index
Matrix1 Utils Command List
Commands Menu
Main Menu

Copyright © Ian Mold - Matrix1 Software 2006 - 2011