GETSPECIALFOLDER function

Purpose: GETSPECIALFOLDER returns the path of a Windows special folder specified by the CSIDLFolder parameter.


 Syntax:
 
 SpecialPath$ = GETSPECIALFOLDER$(CSIDLFolder% [, CreateFlag%=0] [, hWnd=0])

 Parameters:

  • SpecialPath$
  • CSIDLFolder% CSIDL value identifying a special folder commonly used, but differing in name or location, on different operating systems. For example, CSIDL_WINDOWS, value = 0x0024, specifies the folder "C:\Windows" on one system but "C:\Winnt" on another. For specifics on the CSIDL constants, defined in Shlobj.h and Shfolder.h., see the CSIDL section of your Microsoft Windows SDK Help file.
  • CreateFlag% [OPTIONAL] If this parameter is non-zero, then a folder will be created if it doesn't exist.
  • hWnd% [OPTIONAL] is a HWND handle to the owner window the client should specify if the requested folder displays a dialog box or message box.

Example :


 DIM SpecialPath$
 
 SpecialPath$ = GETSPECIALFOLDER$(CSIDL_COMMON_PROGRAMS)
 
 PRINT SpecialPath$
 

Result:

 C:\Documents and Settings\All Users\Start Menu\Programs