Re: Multiple File Conversions via Batch File




"Jon" <Email_Address@xxxxxxxxxxxxxxxxxxxx> wrote in message news:eMJ90WiPGHA.720@xxxxxxxxxxxxxxxxxxxxxxx

<someone@xxxxxxxxxxxxxxxxxxxxxx> wrote in message news:4xGNf.2897$9_.1565@xxxxxxxxxxx
Hello,
I am attempting to convert multiple .wav files to the .flac format via a batch script. I know that this can be done with numerous software implementations automatically for me; however, i am interested to understand how to create a script to perform my purpose and since this function is useful, what the hey! I am rather new to batch files but would appreciate any help. TIA

My process thus far has been the following:

I edited the file type .wav via Tools>Folder Options>File Types I added an option for "Encode to Flac" and pointed this at my "flac-convert.bat %1"

Essentially this works fine; The script runs and encodes one file with ease. At this point my script was:
@ECHO OFF
C:\"Program Files\flac\bin\flac.exe -8 %1


However, when I highlighted multiple .wav files in Explorer and click my "Encode" option multiple instances of the batch file are run. I attempted to solve this with the following code:

@ECHO OFF
:LOOP
FOR %%1 IN (.) DO C:\"Program Files"\flac\bin\flac.exe -8 %%1
SHIFT
IF "%1" == "" GOTO END
GOTO LOOP
:END

When I ran this code I hit another stumbling block. The code was parsing the %1 differently than it had in my original instance where flac was run directly. The filenames contained are something like My_alto-sax_solo.wav When I ran the first script this was parsed fine and the wav file was encoded; but, when the flac.exe was run from within the FOR loop the input file is claimed to be invalid.

So my question is two part:

1)Understanding the parsing of text within a Batch File:

How does passing a command within a FOR alter the way arguments are passed to it?

and

2) Is it possible to only run one instance of the batch file via some setting within Windows?



Change the 1 to a letter i and retry

Jon

Sorry, that was a lazy response.

@ECHO OFF
FOR %%1 IN (%*) DO C:\"Program Files"\flac\bin\flac.exe -8 %%1

Jon

.



Relevant Pages

  • Re: Multiple File Conversions via Batch File
    ... I am attempting to convert multiple .wav files to the .flac format ... via a batch script. ... batch files but would appreciate any help. ... when I highlighted multiple .wav files in Explorer and click ...
    (microsoft.public.vb.general.discussion)
  • Re: Multiple File Conversions via Batch File
    ... I am attempting to convert multiple .wav files to the .flac format via a batch script. ... when I highlighted multiple .wav files in Explorer and click my "Encode" option multiple instances of the batch file are run. ...
    (microsoft.public.windowsxp.general)
  • Re: making a script
    ... batch command: executed successfully. ... I have used gimp's batch processing only slightly, ... You are using the batch mode to execute a scheme script ...
    (comp.graphics.apps.gimp)
  • Re: Automated script to backup IE favorites?
    ... Diego - disregard last message I got it! ... If you don't want to use a batch file, ... you have to create a GPO to run the batch or WSH script on user logoff ... MS MVP Windows - Internet Explorer ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: Returning a value from a VBScript
    ... VBScript for use by another script, batch file, or other command. ... echo MyScript.vbs returned an ErrorLevel of %ErrorLevel% ...
    (microsoft.public.scripting.vbscript)