View Single Post
Old 07-15-2009, 10:19 AM   #6 (permalink)
Patrick Mc
Registered User
 
Join Date: Feb 2009
Posts: 3
OS: Vista


Re: Executing .bat file in multiple subdirectories

The following biterscript may simplify the job. It will convert all .tif files in C:\Winter and its subfolders, sub-subfolders, etc.

As Squashman correctly suggested, I am enclosing fully qualified file names in double quotes, since file names or folder names may contain spaces and other special characters.

Code:
# script convert.txt
# Get a list of .tif files.
var str list ; lf -n "*.tif" "C:\Winter" > $list
# Convert one file at a time.
while ($list <> "")
do
    var str file ; lex "1" $list > $file
    system convert ("\""+$file+"\"") "OTHER OPTIONS AND ARGUMENTS"
done
I have not tested it. Test it first. Save the script as C:\Scripts\convert.txt, start biterscripting ( http://www.biterscripting.com ), enter the following command.

Code:
script convert.txt

Patrick
Patrick Mc is offline   Reply With Quote