English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I'm looking for a batch file which will execute a command to every file in a directory, one by one:

c:\batch\command.exe -blah filename.wmv -output filename.avi

I have 20+ filenames.wmv in the same directory :(

2007-03-30 09:16:00 · 3 answers · asked by Ziggy_73 2 in Computers & Internet Programming & Design

3 answers

FOR %I in (*.wmv) c:\batch\command.exe -blah %I -output %i.avi

ren *.wmv.avi *.avi


rem The first line will run the command and save each file as filename.wmv.avi, the second line will give them the proper names.

2007-03-30 09:36:51 · answer #1 · answered by Vegan 7 · 0 0

I don't know if you can do it with a regular batch file, because batch files are completely useless, but if you install MSYS or Cygwin so you have a unix shell you can use a script like this:

#!/bin/sh
for file in *.wmv; do
command -blah "$file" -output "${file/wmv/avi}"
done

2007-03-30 09:31:29 · answer #2 · answered by undercoloteal 3 · 0 0

Ah, the batch documents. My acquaintances nonetheless use them immediately, yet enable me enable you already know something: they have been suspended from college for messing up computers, ruined their residing house computers and extra. I understand which you're purely fooling around with them, yet once you had code like this it might desire to be very unquestionably abused. I say sorry if it sounds like i'm putting this over your head, yet i won't be in a position to enable you already know counsel on a thank you to try this.

2016-12-08 14:44:31 · answer #3 · answered by okamura 4 · 0 0

fedest.com, questions and answers