5.16.2009

CMD code to display all files on your computer

So you have a computer full of files, and you would like to see a comprehensive list of files all at once? Well, you have to have a windows computer for this to work. Open up command prompt. To list all the folders that aren't hidden on your computer, type in TREE and press enter (this only works for the drive that you are currently on). Now, to save this list to your computer, all you have to do is type in "tree > nameoffile.txt" (without quotes). This will create a new file called nameoffile.txt in the directory your commandprompt is currently working in. This file contains the output that the TREE command would normally give you. To list all of the files along with folders, all you have to do is add /f to the end of your tree command. For example, to save all files and folder's names on your computer to testfile.txt, I would type "tree /f > nameoffile.txt" into the command prompt, ommitting quotes. Also, to make the output of the tree feature more computer more text file friendly, we could add the /a argument to the end of the command just like we did with /f. /a makes all output ASCII. To list all files on my computer in a ttext file named mytextfile.txt with ASCII characters, I would put "tree /a /f > mytextfile.txt" into the command prompt.

1 comment:

  1. How totally cool is that! I am going to write a post about this neat little trick. Thanks

    ReplyDelete