Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works
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,867 posts

Hi,

 

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

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


  • 0

#4
azarl

azarl

    GeekU Admin

  • Administrator
  • 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