terry
Freshman Member
Posts: 15
|
Post by terry on Nov 2, 2014 11:00:55 GMT -5
Hello, Within a macro, you may want to save a file somewhere without hard-coding the folder path. This short macro CSIDL will create a list of the paths to the Windows "Special Folders" that can be used for reference. The list is stored on the Windows clipboard as well as in C:\Users\<user name>\Desktop\CSIDL Values.TXT. The INDEX column indicates the index number used in the OS_GetSpecialFolder(i) function. In the thinBasic help file there is a list of OS Equates that can be used for specific folders, but it isn't always clear exactly what the real path is. Cheers, Terry CSIDL.MACRO (819 B) Example: INDEX LOCATION ----- -------- 0 C:\Users\<user name>\Desktop\ 1 2 C:\Users\<user name>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\ 3 4 5 C:\Users\<user name>\Documents\ 6 C:\Users\<user name>\Favorites\ 7 C:\Users\<user name>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\ 8 C:\Users\<user name>\AppData\Roaming\Microsoft\Windows\Recent\ 9 C:\Users\<user name>\AppData\Roaming\Microsoft\Windows\SendTo\ 10 11 C:\Users\<user name>\AppData\Roaming\Microsoft\Windows\Start Menu\ 12 13 C:\Users\<user name>\Music\ 14 C:\Users\<user name>\Videos\
|
|
|
Post by George on Nov 2, 2014 11:35:03 GMT -5
Terry: Neat. Too often people hard code this stuff and end up with downstream problems as Windows versions change etc. George
|
|
|
Post by George on Nov 3, 2014 13:21:53 GMT -5
Terry: Robert:
Here's the list from one of the PowerBasic Include files.
%CSIDL_DESKTOP = &H0000 ' <desktop>
%CSIDL_INTERNET = &H0001 ' Internet Explorer (icon on desktop)
%CSIDL_PROGRAMS = &H0002 ' Start Menu\Programs
%CSIDL_CONTROLS = &H0003 ' My Computer\Control Panel
%CSIDL_PRINTERS = &H0004 ' My Computer\Printers
%CSIDL_PERSONAL = &H0005 ' My Documents
%CSIDL_FAVORITES = &H0006 ' <user name>\Favorites
%CSIDL_STARTUP = &H0007 ' Start Menu\Programs\Startup
%CSIDL_RECENT = &H0008 ' <user name>\Recent
%CSIDL_SENDTO = &H0009 ' <user name>\SendTo
%CSIDL_BITBUCKET = &H000a ' <desktop>\Recycle Bin
%CSIDL_STARTMENU = &H000b ' <user name>\Start Menu
%CSIDL_MYDOCUMENTS = %CSIDL_PERSONAL ' Personal was just a silly name for My Documents
%CSIDL_MYMUSIC = &H000d ' "My Music" folder
%CSIDL_MYVIDEO = &H000e ' "My Videos" folder
%CSIDL_DESKTOPDIRECTORY = &H0010 ' <user name>\Desktop
%CSIDL_DRIVES = &H0011 ' My Computer
%CSIDL_NETWORK = &H0012 ' Network Neighborhood (My Network Places)
%CSIDL_NETHOOD = &H0013 ' <user name>\nethood
%CSIDL_FONTS = &H0014 ' windows\fonts
%CSIDL_TEMPLATES = &H0015
%CSIDL_COMMON_STARTMENU = &H0016 ' All Users\Start Menu
%CSIDL_COMMON_PROGRAMS = &H0017 ' All Users\Start Menu\Programs
%CSIDL_COMMON_STARTUP = &H0018 ' All Users\Startup
%CSIDL_COMMON_DESKTOPDIRECTORY = &H0019 ' All Users\Desktop
%CSIDL_APPDATA = &H001a ' <user name>\Application Data
%CSIDL_PRINTHOOD = &H001b ' <user name>\PrintHood
%CSIDL_LOCAL_APPDATA = &H001c ' <user name>\Local Settings\Applicaiton Data (non roaming)
%CSIDL_ALTSTARTUP = &H001d ' non localized startup
%CSIDL_COMMON_ALTSTARTUP = &H001e ' non localized common startup
%CSIDL_COMMON_FAVORITES = &H001f
%CSIDL_INTERNET_CACHE = &H0020
%CSIDL_COOKIES = &H0021
%CSIDL_HISTORY = &H0022
%CSIDL_COMMON_APPDATA = &H0023 ' All Users\Application Data
%CSIDL_WINDOWS = &H0024 ' GetWindowsDirectory()
%CSIDL_SYSTEM = &H0025 ' GetSystemDirectory()
%CSIDL_PROGRAM_FILES = &H0026 ' C:\Program Files
%CSIDL_MYPICTURES = &H0027 ' C:\Program Files\My Pictures
%CSIDL_PROFILE = &H0028 ' USERPROFILE
%CSIDL_SYSTEMX86 = &H0029 ' x86 system directory on RISC
%CSIDL_PROGRAM_FILESX86 = &H002a ' x86 C:\Program Files on RISC
%CSIDL_PROGRAM_FILES_COMMON = &H002b ' C:\Program Files\Common
%CSIDL_PROGRAM_FILES_COMMONX86 = &H002c ' x86 Program Files\Common on RISC
%CSIDL_COMMON_TEMPLATES = &H002d ' All Users\Templates
%CSIDL_COMMON_DOCUMENTS = &H002e ' All Users\Documents
%CSIDL_COMMON_ADMINTOOLS = &H002f ' All Users\Start Menu\Programs\Administrative Tools
%CSIDL_ADMINTOOLS = &H0030 ' <user name>\Start Menu\Programs\Administrative Tools
%CSIDL_CONNECTIONS = &H0031 ' Network and Dial-up Connections
%CSIDL_COMMON_MUSIC = &H0035 ' All Users\My Music
%CSIDL_COMMON_PICTURES = &H0036 ' All Users\My Pictures
%CSIDL_COMMON_VIDEO = &H0037 ' All Users\My Video
%CSIDL_RESOURCES = &H0038 ' Resource Direcotry
%CSIDL_RESOURCES_LOCALIZED = &H0039 ' Localized Resource Direcotry
%CSIDL_COMMON_OEM_LINKS = &H003a ' Links to All Users OEM specific apps
%CSIDL_CDBURN_AREA = &H003b ' USERPROFILE\Local Settings\Application Data\Microsoft\CD Burning
' unused &H003c
%CSIDL_COMPUTERSNEARME = &H003d ' Computers Near Me (computered from Workgroup membership)
|
|
terry
Freshman Member
Posts: 15
|
Post by terry on Nov 3, 2014 14:33:57 GMT -5
George, Robert, Power Basic appears to be more up to date than thinBasic. Apparently, Microsoft has superseded CSIDL with KNOWNFOLDERID. Leaving that aside, for thinBasic, I compiled a cross reference of the decimal index values to the thinBasic symbols and the path returned for each. There is one error in the symbolic list from the OS Equates section of the thinBasic help file - the %CSIDL_FLAG_CREATE symbol resolves to the Desktop path, but the term CSIDL_FLAG_CREATE doesn't represent a folder so I wasn't able to determine what index value it represents. Also, there are 2 cases where the same path is returned for 2 different index values which may stem from whether the OS is 32 bit or 64 bit or even what version of Windows is in use. Anyway, the left column contains the decimal Index, the second column contains the thinBasic OS Equate symbol and the third column contains the path returned by the OS_GetSpecialFolder() function. CSIDL Index to Symbolic Cross Reference.TXT (3.46 KB)
|
|