Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

BAT scripts for simple tasks

bat scripts trivial tasks listing files

  • Please log in to reply

#1
b0bl335wa663r

b0bl335wa663r

    Member

  • Member
  • PipPipPip
  • 295 posts

Hi everyone,

 

I wanted to know how to add another extension to the bat script I found while searching around. Here is the script I got :

dir /s /b "drivename:\*.extensionname*" > "list.txt"

It creates a text file with all the names and path of the files with particular extension on the given drive. But I wanted to customise the script like adding another extension, make it list the files more than or less than certain size etc. I did make separate bat files for different file extensions but I wanted to combine all of them in a single one.

 

For now I wanted to add another extensions, and use it for listing files of a particular size. And could anyone suggest some good material to learn these bat scripts?

 

Thanks,

 

Bob


  • 0

Advertisements


#2
Naathim

Naathim

    GeekU Minion

  • Expert
  • 4,568 posts

Hi :)
 
A quite good list of commands may be found here: http://ss64.com/nt/

Also you may find useful things here: http://www.microsoft...h.mspx?mfr=true

And here: http://academic.ever...ogram/batch.htm

And here: http://commandwindows.com/batch.htm

:)


  • 0

#3
SleepyDude

SleepyDude

    Trusted Helper

  • Malware Removal
  • 4,975 posts

Hi,

 

Another good resource with examples and several techniques for common problems...

http://www.robvander.../batchfiles.php


  • 0

#4
azarl

azarl

    GeekU Admin

  • Community Leader
  • 25,310 posts
dir /s /b "drivename:\*.extensionname*" > "list.txt"
dir /s /b "drivename:\*.extensionname2" >> "list.txt"
dir /s /b "drivename:\*.extensionname3" >> "list.txt"

  • 0

#5
b0bl335wa663r

b0bl335wa663r

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 295 posts

Hi :)
 
A quite good list of commands may be found here: http://ss64.com/nt/

Also you may find useful things here: http://www.microsoft...h.mspx?mfr=true

And here: http://academic.ever...ogram/batch.htm

And here: http://commandwindows.com/batch.htm

:)

 

Thanks for the links, they are very informative. :)

 

Hi,

 

Another good resource with examples and several techniques for common problems...

http://www.robvander.../batchfiles.php

 

Thanks, that information from the link solves every little basic problems with batch files. :)

 

dir /s /b "drivename:\*.extensionname*" > "list.txt"
dir /s /b "drivename:\*.extensionname2" >> "list.txt"
dir /s /b "drivename:\*.extensionname3" >> "list.txt"

 

Thanks a lot Azarl. Can you please add the code for size comparison? Like in this case I wanted to list mp4 files with more than 1GB but less than 2GB?


  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP