Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Batch File Script to move find and delete *.tif

Posted on 2010-09-08
5
Medium Priority
?
457 Views
Last Modified: 2012-05-10
Hello,

I am trying to write a batch file that will search a particular directory with sub-folders that have both .tif and .pdf's in them. My goal is to be able to run this script that can search a specific directory's sub-folders for all of the .tif files and delete them. Is this possible using a batch file script? Since all of the sub-folders are named differently I am unsure how to account for those variables.

Thanks to all in advance,

Whah
0
Comment
Question by:Whah
  • 3
5 Comments
 
LVL 7

Expert Comment

by:compaqus
ID: 33630082
for /R c:\folder %i in (*.tif) do {command} %i
0
 
LVL 7

Accepted Solution

by:
compaqus earned 2000 total points
ID: 33630216
this is better :)
FOR /R C:\test\ %%i IN (*.tif) DO del "%%i"
0
 

Author Closing Comment

by:Whah
ID: 33630543
This worked excellent! Nice work and thank you very much for your help it is extremely appreciated.
0
 
LVL 7

Expert Comment

by:compaqus
ID: 33630701
Glad to help!
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying 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

Making a simple AJAX shopping cart Couple years ago I made my first shopping cart, I used iframe and JavaScript, it was very good at that time, there were no sessions or AJAX, I used cookies on clients machine. Today we have more advanced techno…
Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
Suggested Courses

916 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