Command Line Search?

Permabanned
Joined
19 Apr 2006
Posts
2,333
Location
West Yorkshire
I wanna do a search on a drive for all pst files and have it output the results to a txt file (or pref a csv).

Is there easy way of doing this?
 
Make your batch file with the following command:

cd c:\
dir c:\ /s /b | find *.pst > pstfiles.txt
exit

That should work ok.
 
doesnt seem to work:

File not found - *.pst

dont think you can use wildcards with the FIND command.

however:
Code:
dir i:\*.pst /s > c:\pstfiles.txt

:does work but the format is not quite how I need it.

I could do with the output being something like:

I:\folder1\outlook.pst 299,333,013 bytes
I:\folder1\archive.pst 29,333,013 bytes

in that sort of layout!
 
The_KiD said:
doesnt seem to work:



dont think you can use wildcards with the FIND command.

however:
Code:
dir i:\*.pst /s > c:\pstfiles.txt

:does work but the format is not quite how I need it.

I could do with the output being something like:



in that sort of layout!

run a find and replace on the text file, change every "I:\" to "CR I:\" with CR as carrage return.
 
The_KiD said:
doesnt seem to work:



dont think you can use wildcards with the FIND command.

however:
Code:
dir i:\*.pst /s > c:\pstfiles.txt

:does work but the format is not quite how I need it.

I could do with the output being something like:



in that sort of layout!

So at the end of that script do some file maniplulation. This site might help you:

http://dostips.cmdtips.com/DtTipsStringManipulation.php
 
Back
Top Bottom