@PATH[filename]:  Returns the path portion of filename, if present, including the drive letter and a trailing backslash but not including the base name or extension. If the filename parameter doesn't contain path information, you may expand it first with the @FULL function.


The filename must be in quotes if it contains white space or special characters. On an LFN or NTFS drive, the returned filename may contain white space or other special characters. To avoid problems which could be caused by these characters, quote the returned name before you pass it to other commands. See the notes under Variable Functions for additional details.


Note: The @PATH function makes no assumption about the existence of a file or directory. Its filename parameter can be any string, and the function will attempt to remove from it a "base name".




echo "%@path["c:\program files\xyz.abc"]

"c:\program files\"


echo "%@path[xyz.abc]"