Post by terry on Nov 2, 2014 11:00:55 GMT -5
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.
0 C:\Users\<user name>\Desktop\
C:\Users\<user name>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\
C:\Users\<user name>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\
C:\Users\<user name>\AppData\Roaming\Microsoft\Windows\Start Menu\
Post by terry on Nov 3, 2014 14:33:57 GMT -5
Power Basic appears to be more up to date than thinBasic. Apparently, Microsoft has superseded CSIDL
. 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