Use any of the following options to display the usage:
SpecialFolderPath SpecialFolderPath /? SpecialFolderPath --help SpecialFolderPath -h
The first variant is the most easy one: The help will also be displayed when SFP is run without any command line arguments at all.
See Usage for the usage information displayed.
This is an issue only for special folders such as "My Pictures", which are only created when certain applications are used.
Example:
SpecialFolderPath --nocreate CSIDL_MYPICTURES
will display the path of the "My Pictures" folder, but only if it exists. Otherwise, just an empty line will be displayed.
When the --nocreate
option is not being specified, the default is to create the folder if it does not yet exist.
This is usually necessary, because the Win32 function that provided the information to SFP uses the Windows code page, while the console (and batch scripts that run as console processes) may use a different code page.
So, if you use SFP to provide some path information to your batch script, the default of not using --not2oem
is exactly what you want.
But if you intend to use the output of SFP in a Windows text file, you may specify --not2oem
to leave the paths in the windows code page.
An example:
SpecialFolderPath --not2oem CSIDL_PROGRAM_FILES >> info.txt
This will append the path of the "Program Files" folder to the current contents of the existing windows text document "info.txt", which may then be displayed using notepad
.
Next: Application in batch files