I need to find the name of the parent directory for a file in DOS
for ex.
Suppose this is the directory
C:\\test\\pack\\a.txt
call :set_dirname "%cd%" echo %DIRNAME% :set_dirname set DIRNAME=%~n1 goto :eof