Simple command line tool that reports the locations of the various special Windows system folders.
Coyright 2003 Guenther Brunthaler
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
However, one of the typical obstacles for writers of portable batch files is the different directory layout of different installations.
For instance, one site may use "C:\Program Files" as the path to the application base directory, while a different site may use "D:\win32\Program Files" for the same purpose.
Even more important is the path to the current user's "My Folders".
Until recently, the best thing a batch programmer could do was to set up environment variables at the beginning of the scripts where all required directory paths were defined at a central place.
Then, each time a batch file was deployed, those assignments had to be updated in order to reflect the actual site directory structure.
This was especially cumbersome with per-user settings such as "My Folders", because hard-coding such settings required each user to have its own instance of the batch script instead of a single instance shared among all users.
Fortunately, SpecialFolderPath now provides a solution to this problem!
SpecialFolderPath (from now on only referred to as 'SFP' in the remaining text for the sake of brevity) uses an existing Win32 API function internally which addresses the issue of obtaining various system-global or user-specific directory paths.
It then exposes that functionality to batch programmers in a straightforward and safe way.
Using SFP, batch script can now be shared among the different users on a system.
The scripts can even be stored on a network server, shared by all the users on all the machines: SFP allows the batch script to query for site-specific directory layout information, without a further need for hard-coding any paths in the batch files themselves!
Next: Invoking SpecialFolderPath