"Simon Truong" wrote
> How could I retrieve the current directory name in a batch script?


The Mount/\Command "GetCD" displays the current directory and saves the
value in the variable %#cd%.

GetCD performs CONSISTENTLY under NT/2K/XP/K3. It is included in the FREE
Advanced NT/2K/XP/K3 Command Library (http://ntlib.com).

See the GetCD Page for details and color-keyed examples:
(http://TheSystemGuard.com/MtCmds/GetValue/GetCD.htm)

*******

To obtain the current directory of all accessible local and mapped drive
letters, see ".ListCD" at
(http://TheSystemGuard.com/MtCmds/ListValue/ListCD.htm)

To obtain a list of all available (unused and unmapped) drive letters, see
".ListAvail" at
(http://TheSystemGuard.com/MtCmds/Lis.../ListAvail.htm)

*******

-tsg
__________________________________________________ __________
TheSystemGuard.com | BoomingOrFuming.com | MountCommands.com
Free and "Almost Free" Knowledge for Windows System Admins!