4 Replies Latest reply on Nov 27, 2007 1:19 AM by Newsgroup_User

    Need numeric Windows special folder codes for baSysFolder

    Applied CD Level 1
      Does anyone have a link to a table of special folder codes for use with Buddy API? I used to have nice table that included the new folders for Vista but now I can’t find it … all I’m finding with Google are string codes, not the numeric codes that Buddy API requires. The help files say the codes are in the ShlObj.h header file in the Windows SDK but I haven’t had much luck finding a copy of that either.
        • 1. Re: Need numeric Windows special folder codes for   baSysFolder
          Level 7
          Put this in a movie script and run getSpecialFolders() from the Message
          Window. It will enumerate all of the ones on the current machine:

          on getSpecialFolders
          repeat with i=1 to 60
          put i&&"->"&&baSysFolder(string(i))
          end repeat
          end
          • 2. Re: Need numeric Windows special folder codes for   baSysFolder
            Level 7
            In case you do not have a Vista machine to run it on, here is the output
            from my Vista Ultimate installation:

            -- "2 -> C:\Users\mike\AppData\Roaming\Microsoft\Windows\Start
            Menu\Programs\"
            -- "5 -> C:\Users\mike\Documents\"
            -- "6 -> C:\Users\mike\Favorites\"
            -- "7 -> C:\Users\mike\AppData\Roaming\Microsoft\Windows\Start
            Menu\Programs\Startup\"
            -- "8 -> C:\Users\mike\AppData\Roaming\Microsoft\Windows\Recent\"
            -- "9 -> C:\Users\mike\AppData\Roaming\Microsoft\Windows\SendTo\"
            -- "11 -> C:\Users\mike\AppData\Roaming\Microsoft\Windows\Start Menu\"
            -- "13 -> C:\Users\mike\Music\"
            -- "14 -> C:\Users\mike\Videos\"
            -- "16 -> C:\Users\mike\Desktop\"
            -- "19 -> C:\Users\mike\AppData\Roaming\Microsoft\Windows\Network
            Shortcuts\"
            -- "20 -> C:\Windows\Fonts\"
            -- "21 -> C:\Users\mike\AppData\Roaming\Microsoft\Windows\Templates\"
            -- "22 -> C:\ProgramData\Microsoft\Windows\Start Menu\"
            -- "23 -> C:\ProgramData\Microsoft\Windows\Start Menu\Programs\"
            -- "24 -> C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup\"
            -- "25 -> C:\Users\Public\Desktop\"
            -- "26 -> C:\Users\mike\AppData\Roaming\"
            -- "27 -> C:\Users\mike\AppData\Roaming\Microsoft\Windows\Printer
            Shortcuts\"
            -- "28 -> C:\Users\mike\AppData\Local\"
            -- "29 -> C:\Users\mike\AppData\Roaming\Microsoft\Windows\Start
            Menu\Programs\Startup\"
            -- "30 -> C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup\"
            -- "31 -> C:\Users\mike\Favorites\"
            -- "32 -> C:\Users\mike\AppData\Local\Microsoft\Windows\Temporary
            Internet Files\"
            -- "33 -> C:\Users\mike\AppData\Roaming\Microsoft\Windows\Cookies\"
            -- "34 -> C:\Users\mike\AppData\Local\Microsoft\Windows\History\"
            -- "35 -> C:\ProgramData\"
            -- "36 -> C:\Windows\"
            -- "37 -> C:\Windows\System32\"
            -- "38 -> C:\Program Files\"
            -- "39 -> C:\Users\mike\Pictures\"
            -- "40 -> C:\Users\mike\"
            -- "41 -> C:\Windows\System32\"
            -- "42 -> C:\Program Files\"
            -- "43 -> C:\Program Files\Common Files\"
            -- "44 -> C:\Program Files\Common Files\"
            -- "45 -> C:\ProgramData\Microsoft\Windows\Templates\"
            -- "46 -> C:\Users\Public\Documents\"
            -- "47 -> C:\ProgramData\Microsoft\Windows\Start
            Menu\Programs\Administrative Tools\"
            -- "48 -> C:\Users\mike\AppData\Roaming\Microsoft\Windows\Start
            Menu\Programs\Administrative Tools\"
            -- "53 -> C:\Users\Public\Music\"
            -- "54 -> C:\Users\Public\Pictures\"
            -- "55 -> C:\Users\Public\Videos\"
            -- "56 -> C:\Windows\Resources\"
            -- "59 -> C:\Users\mike\AppData\Local\Microsoft\Windows\Burn\Burn\"
            • 3. Re: Need numeric Windows special folder codes for   baSysFolder
              Applied CD Level 1
              Lol, thanks Mike … I didn’t think about having Buddy API just dump the list, also, thanks for your list, I don’t have Vista here in the office. Looks like I need 26.
              • 4. Re: Need numeric Windows special folder codes for baSysFolder
                Level 7
                Applied CD wrote:
                > Does anyone have a link to a table of special folder codes for use
                > with Buddy API? I used to have nice table that included the new
                > folders for Vista but now I can?t find it ? all I?m finding with
                > Google are string codes, not the numeric codes that Buddy API
                > requires. The help files say the codes are in the ShlObj.h header
                > file in the Windows SDK but I haven?t had much luck finding a copy of
                > that either.

                From the Windows Server 2003 SDK:-

                //===========================================================================
                //
                // Copyright (c) Microsoft Corporation. All rights reserved.
                //
                // File: shlobj.h
                //
                //===========================================================================
                <snip>
                //-------------------------------------------------------------------------
                //
                // SHGetSpecialFolderLocation
                //
                // Caller should use SHGetMalloc to obtain an allocator that can free the
                pidl
                //
                //
                //-------------------------------------------------------------------------
                //
                // registry entries for special paths are kept in :
                #define REGSTR_PATH_SPECIAL_FOLDERS REGSTR_PATH_EXPLORER TEXT("\\Shell
                Folders")


                #define CSIDL_DESKTOP 0x0000 // <desktop>
                #define CSIDL_INTERNET 0x0001 // Internet Explorer
                (icon on desktop)
                #define CSIDL_PROGRAMS 0x0002 // Start Menu\Programs
                #define CSIDL_CONTROLS 0x0003 // My Computer\Control
                Panel
                #define CSIDL_PRINTERS 0x0004 // My
                Computer\Printers
                #define CSIDL_PERSONAL 0x0005 // My Documents
                #define CSIDL_FAVORITES 0x0006 // <user
                name>\Favorites
                #define CSIDL_STARTUP 0x0007 // Start
                Menu\Programs\Startup
                #define CSIDL_RECENT 0x0008 // <user name>\Recent
                #define CSIDL_SENDTO 0x0009 // <user name>\SendTo
                #define CSIDL_BITBUCKET 0x000a // <desktop>\Recycle
                Bin
                #define CSIDL_STARTMENU 0x000b // <user name>\Start
                Menu
                #define CSIDL_MYDOCUMENTS 0x000c // logical "My
                Documents" desktop icon
                #define CSIDL_MYMUSIC 0x000d // "My Music" folder
                #define CSIDL_MYVIDEO 0x000e // "My Videos" folder
                #define CSIDL_DESKTOPDIRECTORY 0x0010 // <user name>\Desktop
                #define CSIDL_DRIVES 0x0011 // My Computer
                #define CSIDL_NETWORK 0x0012 // Network
                Neighborhood (My Network Places)
                #define CSIDL_NETHOOD 0x0013 // <user name>\nethood
                #define CSIDL_FONTS 0x0014 // windows\fonts
                #define CSIDL_TEMPLATES 0x0015
                #define CSIDL_COMMON_STARTMENU 0x0016 // All Users\Start
                Menu
                #define CSIDL_COMMON_PROGRAMS 0X0017 // All Users\Start
                Menu\Programs
                #define CSIDL_COMMON_STARTUP 0x0018 // All Users\Startup
                #define CSIDL_COMMON_DESKTOPDIRECTORY 0x0019 // All Users\Desktop
                #define CSIDL_APPDATA 0x001a // <user
                name>\Application Data
                #define CSIDL_PRINTHOOD 0x001b // <user
                name>\PrintHood

                #ifndef CSIDL_LOCAL_APPDATA
                #define CSIDL_LOCAL_APPDATA 0x001c // <user name>\Local
                Settings\Applicaiton Data (non roaming)
                #endif // CSIDL_LOCAL_APPDATA

                #define CSIDL_ALTSTARTUP 0x001d // non localized
                startup
                #define CSIDL_COMMON_ALTSTARTUP 0x001e // non localized
                common startup
                #define CSIDL_COMMON_FAVORITES 0x001f

                #ifndef _SHFOLDER_H_
                #define CSIDL_INTERNET_CACHE 0x0020
                #define CSIDL_COOKIES 0x0021
                #define CSIDL_HISTORY 0x0022
                #define CSIDL_COMMON_APPDATA 0x0023 // All
                Users\Application Data
                #define CSIDL_WINDOWS 0x0024 //
                GetWindowsDirectory()
                #define CSIDL_SYSTEM 0x0025 //
                GetSystemDirectory()
                #define CSIDL_PROGRAM_FILES 0x0026 // C:\Program Files
                #define CSIDL_MYPICTURES 0x0027 // C:\Program Files\My
                Pictures
                #endif // _SHFOLDER_H_

                #define CSIDL_PROFILE 0x0028 // USERPROFILE
                #define CSIDL_SYSTEMX86 0x0029 // x86 system
                directory on RISC
                #define CSIDL_PROGRAM_FILESX86 0x002a // x86 C:\Program
                Files on RISC

                #ifndef _SHFOLDER_H_
                #define CSIDL_PROGRAM_FILES_COMMON 0x002b // C:\Program
                Files\Common
                #endif // _SHFOLDER_H_

                #define CSIDL_PROGRAM_FILES_COMMONX86 0x002c // x86 Program
                Files\Common on RISC
                #define CSIDL_COMMON_TEMPLATES 0x002d // All Users\Templates

                #ifndef _SHFOLDER_H_
                #define CSIDL_COMMON_DOCUMENTS 0x002e // All Users\Documents
                #define CSIDL_COMMON_ADMINTOOLS 0x002f // All Users\Start
                Menu\Programs\Administrative Tools
                #define CSIDL_ADMINTOOLS 0x0030 // <user name>\Start
                Menu\Programs\Administrative Tools
                #endif // _SHFOLDER_H_

                #define CSIDL_CONNECTIONS 0x0031 // Network and Dial-up
                Connections
                #define CSIDL_COMMON_MUSIC 0x0035 // All Users\My Music
                #define CSIDL_COMMON_PICTURES 0x0036 // All Users\My
                Pictures
                #define CSIDL_COMMON_VIDEO 0x0037 // All Users\My Video
                #define CSIDL_RESOURCES 0x0038 // Resource Direcotry

                #ifndef _SHFOLDER_H_
                #define CSIDL_RESOURCES_LOCALIZED 0x0039 // Localized Resource
                Direcotry
                #endif // _SHFOLDER_H_

                #define CSIDL_COMMON_OEM_LINKS 0x003a // Links to All Users
                OEM specific apps
                #define CSIDL_CDBURN_AREA 0x003b // USERPROFILE\Local
                Settings\Application Data\Microsoft\CD Burning
                // unused 0x003c
                #define CSIDL_COMPUTERSNEARME 0x003d // Computers Near Me
                (computered from Workgroup membership)
                <snip>

                Andrew