This is a direct extension of this question:
How to do something to each file in a directory with a batch script
From the above I leaned how to execute a command for every file in a folder.
How do you execute MULTIPLE commands for each file? I want to first use lame to compress the file, then MOVE the original file to a different directory
This is what I have so far:
FOR /r cutAndPendingCompression %%f IN (*.*) DO lame %%f compressed\%%~nf -m m -b 16 --vbr-new -V 9 --scale 2.5
Instead of scheduling multiple Windows Tasks that may overlap, use the "start /wait" command a batch file (. bat) to automatically run multiple commands in sequential order.
Use double percent signs ( %% ) to carry out the for command within a batch file. Variables are case sensitive, and they must be represented with an alphabetical value such as %a, %b, or %c. Required. Specifies one or more files, directories, or text strings, or a range of values on which to run the command.
You can run two commands in one line in Windows Command Prompt. For that, you need to create a batch script file using Notepad. Below, we have shared the two best methods to run multiple commands in CMD on Windows 10 computers.
This did it
FOR /r cutAndPendingCompression %%f IN (*.*) DO (
lame %%f compressed\%%~nf -m m -b 16 --vbr-new -V 9 --scale 2.5
move %%f cut\%%~nf
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With