Batch Script for many files

December 2, 2009 at 08:23:46
Specs: Windows Vista
hi, so 'im trying to run a batch script. its not
supposed to be very difficult.
i run an encoding machine for audio at the
company i work at. it is run by a basic dos
command line. you put in the exe name then
input location and output location. i want to
make it so that it does a long list of files and
not just one but i cant figure out how to get it
to pull multiple names from a folder. so i have
an encoder, 170 files , and i need to run a
batch that will grab every file and do the
encoding to it. can anyone help me?

See More: Batch Script for many files

Report •

December 2, 2009 at 08:34:13
What is the syntax for your encoder and the path that the encoder tool is located?

Report •

December 2, 2009 at 08:36:13
first goes the exe.

encoder.exe (input file) (output file)

Report •

December 2, 2009 at 08:43:07
i have an entire directory of audio files. all .wav's.
normally i open cmd, and just run,

encoder.exe file1.wav file1.bit

this will get through 1.

then i'd have to run it again for the next file.

so i output the file names with dir /b >text.txt

now i dont know how to get it to read the list and as the input

Report •

Related Solutions

December 2, 2009 at 08:45:52
srry if this doesnt make sense, im trying to give u as much info
as i can. i dont need this specific to my program, cuz i
understand batches, and i can change folder addresses and file
names and such. but a basic layout that i could put my own
actual program names and filenames into would work amazing.
Please help! i appreciate any advice anyone can give me

Report •

December 2, 2009 at 08:50:18
oh also, the encoder tool is in the same dir as all the audio files.
i'd like to be able to put the encoded files in a different dir.

Report •

December 2, 2009 at 09:02:30
@echo off
For /F "tokens=1,2 delims=." %%A in ('DIR *.wav /b') do (
encoder %%A.%%B %%A.bit)

I think will work but I don't have the path that the encode.exe is in so it may not find the encode.exe. Make sure encode.exe is in the same directory as your WAV files or tell me where the encode.exe is.

Oh never mind I just saw your last post.

Report •

December 2, 2009 at 09:07:06
i'll try this out. thanks a bunch. i'll let you know how it goes.

Report •

December 7, 2009 at 09:41:06

Here is just another solution using biter scripting language.

To do the same thing for many files - it is a common technique called the file loop. See this tutorial - - Section 4.1. FILE DIRECTORY LOOP.

The script for your requirement can be as follows.

var str list, file, name ; lf -n "*.wav" > $list
while ($list <> "")
    lex "1" $list > $file ; stex -p "]^.^" $file > $name
    encoder.exe $file ($name+".bit")

Report •

Ask Question