title: How do I perform string operations on variables in a for loop?
body: <p>This sounds dumb, but I can't get it to work. I think i just dont' understand the difference between <code>%%v, %v% and %v</code></p>
  
  <p>Here's what I'm trying to do:</p>
  
  <pre><code>for %%v in (*.flv) do ffmpeg.exe -i "%%v" -y -f mjpeg -ss 0.001 -vframes 1 -an "%%v.jpg"
  </code></pre>
  
  <p>This successfully generates a thumbnail for each of the movies, but the problem is:</p>
  
  <pre><code>movie.flv -&gt; movie.flv.jpg
  </code></pre>
  
  <p>So what I would like to do is pull the last 4 characters off <code>%%v</code> and use that for the second variable.</p>
  
  <p>I've been trying things like this:</p>
  
  <pre><code>%%v:~0,-3%
  </code></pre>
  
  <p>But it's not working, nor are any of the iterations of that that I could think of.</p>
  
  <p>Any ideas?</p>