Directory and Sub Directory listing
- by shekhar
I am trying to list the directory name (only name, not full path) and sub directories (only name, not full path) inside it. There is only one level of sub directories. I used below script to do this:
@echo off&setlocal enableextensions
for /r "PATH" %%G in (.) do (
Pushd %%G
for %%* in (.) do set MyDir=%%~n*
echo %MyDir%
popd
)
endlocal&goto :eof
The problem with the above script is that it is showing root directory with the full path. How can I just make it show the directories in relation to the one I am working in?