Code: Select all
@ECHO OFF
set K1=N:\ABC
FOR /F "Tokens=*" %%U IN ('DIR "%K1%\!!*.BAT" /A-D /B /ON /S') DO (
FOR %%V IN ("%%~fU") DO (
FOR %%W IN ("%%~pV.") DO (
FOR %%X IN ("%%~pV..") DO (
ECHO %%~nxX \ %%~nxW \ %%~nxV
)
)
)
)
is it possible to find parent directory names and current directory names in an ok way?
m:\abc\123\xyz\qwe.txt
xyz is the current dir name
123 is the parent dir name