Solved

Batch File search

Posted on 2008-10-09
2
232 Views
Last Modified: 2012-05-05
I want to write a batch file which will search my entire C:\ including subfolders and return me all the file names, their location and the size as a comma seperated output.
0
Comment
Question by:michaelm702
2 Comments
 

Expert Comment

by:ddougie
ID: 22684370
You may have more luck looking into scripts for this, because batch files may be a little too primative.  I don't have too much experience with script writing, but the command "dir >> filename.txt" will save the output of your directory as a txt file (though it is not comma seperated, it may be helpful).
0
 
LVL 1

Accepted Solution

by:
benaiah earned 50 total points
ID: 23202042
Why do you need them to be comma separated?

the following code will output all the file names, including full path, one file name per line with no other text.

the file filename.txt will be in the root of the C drive.

I'll get working on how to make them coma separated. Do you mean all on one line with commas separating or each on its own line with a comma at the end of each line?
cd c:

cd \
 

dir /s /b >> filename.txt
 
 

pause

Open in new window

0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

If like me you are one who spends a lot of time working and scripting with cmd.exe, sometimes it is handy to be able to quickly view a calendar for a given month and year. This script will quickly do just that!  Save the code posted below to a .bat …
You may have already been in the need to update a whole folder stucture using a script. Robocopy does it well and even provides a list of non-updated files in a log (if asked to). Generally those files that were locked by a user or a process by the …
This video discusses moving either the default database or any database to a new volume.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now