How-Tos

How to get a directory listing on Windows using batch files

I know there are programs that do the job much better but I like it the dirty way: batch files.
It’s fast, no installation required and does what I want. Enough talk, here is the code:

@dir %1 /w /b /o:gn > "_listing.txt"

Copy the code to a text file and change its extension to .bat
/b – bare format, remove this for detailed info
/o:gn > “_listing.txt” – sends the output to “_listing.txt”

For further customization, type dir /? on a command prompt.

Standard
  • Emil

    this is really cool.