Solved

Batch File search

Posted on 2008-10-09
2
237 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The following is a collection of cases for strange behaviour when using advanced techniques in DOS batch files. You should have some basic experience in batch "programming", as I'm assuming some knowledge and not further explain the basics. For some…
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 …
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

696 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