I would like to get a directory structure in Windows like the output of dir /S, but only line beginning like this: Directory of...

  • dir /s /ad /b or tree – user364455 Apr 28 '15 at 16:11

If you insist on Directory of, this might help (running from a command line):

for /f "delims==" %i in ('dir /s ^| find "Directory of"') do @echo %i

Running from a batch file, double the percentage:

@for /f "delims==" %%i in ('dir /s ^| find "Directory of"') do @echo %%i

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.