Solved

Batch File search

Posted on 2008-10-09
2
235 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

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

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

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 …
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

792 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