1

In order for me to get the results of a file search in a readable format, I use the following command line in a command prompt:

dir *.* /s > myResultList.txt

I then open that list in Excel, use fixed width format to get rid of all the stuff I don't want and then I have my list.

Seems like a lot to do for something so simple.

Does anyone out there have any recommendations for something that would work better than this?

1
  • Question will be better phrased by including the information you DO want to extract from the DIR results.
    – Shevek
    May 13, 2010 at 10:19

3 Answers 3

1

It's a little hard to understand what exactly you're aiming for, but you can get a plain list of files by including the /b switch to dir:

dir /s /b *>foo.txt

If you have requirements for the exact format of the output, then perhaps a for loop might be more appropriate:

(for /r %x in (*) do (@echo."%x";%~tx;%~zx))>foo.csv

This would output a CSV file with the file names, their modification date and time and the file size, which you can easily open in Excel.

If you want a fixed-width format of custom columns—that's ... a little much more complex and I won't provide that here.

1

Using 'Powershell' and the 'Powershell Community Extensions' you will get access to the get-clipboard and out-clipboard commands, which can be used as explained here.

Another candidate: 'nircmd.exe' with the clipboard subcommand. Finally, try 'clip.exe' to pipe output to the clipboard on the command line.

UPDATE:

Since Vista, there seems to be a clip.exe in C:\Windows\system32.

0

find allows you to specify various criteria for searching for files, and lets you generate output using various formatting options.

1
  • 1
    i think his real problem is not the search/find but how to transfer the result of (basically any commandline operation) into excel/word etc.
    – akira
    May 13, 2010 at 10:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .