Question : Drag N Drop: FLAC batch decode file/files/folder/folders

Hi,

I would like to drag and drop file/files/folder/folders to a batch file to decode my FLAC files to WAV.

1) Decoded files will be generated in the same folder as the original.

Any takers?

Answer : Drag N Drop: FLAC batch decode file/files/folder/folders

Files dragged to a batch file will simply be passed as command line arguments.
You can only address the first 9 (%1 to %9) command line arguments individually, so you'll need to work with "shift" in case you drag more than 9 files to the batch.
As a framework (you obviously need to replace TheDecoder.exe with whatever application you're using, and adjust the arguments accordingly):
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
@echo off
setlocal
set OutputFileExtension=.wav
REM *** process the command line until it's empty:
:loop
set InputFile=%~1
set InputFileFolder=%~dp1
set InputFileName=%~n1
set InputFileExtension=%~x1
set OutputFile=%InputFileFolder%%InputFileName%%OutputFileExtension%
echo Decoding %InputFileName%%InputFileExtension% to %OutputFileExtension% ...
ECHO TheDecoder.exe /input="%InputFile%" /output="%OutputFile%"
shift
if not "%~1"=="" goto loop
echo Done.
pause
Open in New Window Select All
Random Solutions  
 
programming4us programming4us