The Mudcat Café TM
Thread #115183   Message #2464164
Posted By: JohnInKansas
13-Oct-08 - 03:37 AM
Thread Name: Tech: How many files???
Subject: RE: Tech: How many files???
XTREE is not a recognized command in Vista or WinXP.

Any "possibly DOS" command can be easily checked out using the Command (DOS) window. Just type the name of something you might think is a DOS command, followed by "/?" (without the quotes) and if it is a valid command you'll get a description of the form(s) in which you can use it, with all the switches and options. If it's not a valid command, you'll be told that Windows doesn't recognize it, with only a slight smirk about what an idiot you are for having asked.

The same /? tag will get similar descriptions for quite a number of not-DOS windows command line functions, although there are still some for which it doesn't work.

Theoretically, you could get an alphabetical list of all the files on your computer using the DIR command, piping it through the SORT filter:

DIR *.* /s | SORT

To avoid waiting for all the trash to flash by on your monitor, it's quicker to redirect the result to a file, so:

DIR *.* /s | SORT > SortedFiles.txt

The | key, called the "pipe," is the shifted backslash (Shift-\) key on US keyboards. It sends the output of one process (Dir *.* /S) to another process (Sort), and the > is here called a "redirect" which in this case sends the final result to a file with filename "whatever you type after the >"

For my C:\Documents folder, I get 3,463 pages of "result" but in Word, global replacements can be "easily" (a euphemism for "you do need to know what you're replacing") used to "simplify" it down to a slightly more manageable size.

In the latest Windows versions, the DIR command itself allows a switch /O (for Order) that you can use to list and sort the filenames in a single command:

DIR *.* /S /O:N

to sort alphabetically by filename.

The sorted list of filenames can be used easily to identify duplications, but unfortunately the sorting loses any association for each file with the folder(s) where it appears. More complex sort/replace edits can theoretically overcome this difficulty; but as a practical matter it's easier just to identify a filename that's present several times and then do a "DIR filename /S" to see where it appears, if you want to select which duplicates to remove.

John