How do I perform string operations on variables in a for loop?

前端 未结 5 796
遇见更好的自我
遇见更好的自我 2021-02-06 06:57

This sounds dumb, but I can\'t get it to work. I think i just dont\' understand the difference between %%v, %v% and %v

Here\'s what I\'m trying to do:

5条回答
  •  梦如初夏
    2021-02-06 07:34

    Yet another way that I prefer is to create a sub-routine (:processMpeg) that I call for each element in the For loop, to which I pass the %%v variable.

    for %%v in (*.flv) do call :processMpeg "%%v"
    goto :eof
    
    :processMpeg
      set fileName=%~n1
      echo P1=%1  fileName=%fileName%  fullpath=%~dpnx1
      ffmpeg.exe -i "%~1" -y -f mjpeg -ss 0.001 -vframes 1 -an "%filename%.jpg"
      goto :eof
    

提交回复
热议问题