Do you want to print a list of directory and it’s contents to a file. dir and tree command will be helpful.
dir:
dir command will list the contents of a directory.
if you want to all directories, one after the other, in alphabetical order, in wide format and pausing after each screen on the disk in your current drive,, type the following command (a.txt )
dir /s/w/o/p
dir /s/w/o/p > “a.txt” (output results to a text file )
/S : include subdirectories
/W : list in wide format
/O : alphabetical order
/p : pause after each screen
tree:
tree command will show the directory tree of the current directory
To display the tree structure of all the directory on the disk in your current drive, type: (output results to a text file )
tree > “a.txt”
tree /A > “a.txt” – Use ASCII characters
tree /F > “a.txt” – Displays the names of the files in each folder
Like ThePicky, follow us on Twitter, or get daily updates via email.
Related entries:- How do Flush DNS Cache in Windows and Linux
- How to get Latest Windows XP service pack
- How to Open .gz File in Windows
- What is DoS attack or denial-of-service attack ?
- What is Windows Safe Mode?
- Types of Safe Mode Options in Windows
- How to Start Windows in Safe Mode
- Windows 7 Features
- Enabling Windows Remote Desktop
- Windows Live Writer: Blog-Publishing Application
