title: Mimic dragging and dropping file over executable?
body: <p>I use a free program in Windows called &quot;Levelator&quot; to normalize the audio in WAV files, it doesn't just normalize the whole WAV file - it makes quiet voices louder and loud voices quieter so the output file is all the same volume throughout. If there was any other free tool that did this (and could do it on the command line) I would be using it, but I have never found anything else that does this.</p>
  <p>When this Levelator program is run, it opens a GUI. To process a WAV file, you just drag the WAV file over the GUI and it spits out a &quot;.output.wav&quot; version of your original &quot;.wav&quot; file. You can also drag the WAV file over the executable of Levelator (without running Levelator) and get the output file that way.</p>
  <p>What you cannot do is use it on the command line, in any way!</p>
  <p>Nothing I have tried will work in a batch file, for example this:</p>
  <pre><code>start /wait Levelator.exe myaudio.wav
  </code></pre>
  <p>Or with quotes:</p>
  <pre><code>start /wait Levelator.exe &quot;myaudio.wav&quot;
  </code></pre>
  <p>Results in the error: &quot;Can't open the source file: myaudio.wav&quot;</p>
  <p>Also, running this brings up nothing:</p>
  <pre><code>Levelator.exe /?
  </code></pre>
  <p>That just causes the same error: &quot;Can't open the source file: /?&quot;</p>
  <p>I got thinking about this and wondered, if you can drag the WAV file over the executable, why can't that be handled in a batch file? If the first command above doesn't work, why not? Why are you forced to either drag the WAV file over the GUI or drag the WAV over the executable?</p>
  <p>It's odd that the program can't open a WAV file by specifying the file name after Levelator.exe in a batch file. It seems impossible to do it.</p>
  <p>It's frustrating because I always have to manually drag WAV files over the GUI, but with a batch file (and creating a variable for the name of any WAV) it would be miles easier.</p>
  <p>Since this can't work in a batch file, how can I mimic dragging and dropping on the command line? This is the only way to do it. I would usually use AutoIt2 for this sort of thing but the position of the WAV file in a folder can't be guessed at, so it can't be done that way either, AutoIt2 just isn't that advanced and needs window coordinates to drag something somewhere.</p>
  <p>I know it's a tall order, that's why I ask it here :p</p>
  <p>EDIT: The suggestion by user14122392 led to making it work :)</p>
  <p>I put the following in a batch file next to Levelator.exe and the WAV file, hopefully it's made universal so no editing is needed, it can just run if a WAV file is put there...</p>
  <pre><code>For %%a IN (&quot;*.wav&quot;) DO Set &quot;WAVFILE=%%~na&quot;
  start /wait levelator.exe &quot;%~dp0\%WAVFILE%.wav&quot;
  </code></pre>
  <p>This allows for a WAV file with any filename (not sure about file names with a &quot;!&quot; character, I know Levelator doesn't like them) and by using &quot;%~dp0&quot; it is enough to fool it into working.</p>