CMD Print DIR to text file

dir > print.txt

The ">" symbol is telling to put the output of the command to whatever is next. In this case "print.txt". This is useful for writing any output to a file in a script or whatever.

Example: dir > %USERPROFILE%\Desktop\print.txt

This example will print the directory listing to print.txt on your desktop.

Other flags:

dir /b file names only

dir /s include all sub folders & files

Original source:

Actually I really like that site, and spent some time taking their quiz. Entertaining.


Popular posts from this blog

Simple powershell ping log with timestamp

DNS entries needed for MLB app

Lockdown Browser LAB SCCM deployment