Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Batch File search

Posted on 2008-10-09
2
Medium Priority
?
241 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 150 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

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 …
Introduction: Recently, I got a requirement to zip all files individually with batch file script in Windows OS. I don't know much about scripting, but I searched Google and found a lot of examples and websites to complete my task. Finally, I was ab…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

609 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