1.

Solve : Batch file literals '%'?

Answer»

From a Batch-file, how can I CALL an external program that requires a -literal- '%' in it's COMMAND line without the batch file evaluating the '%' as a batch-parameter?

Example: FFMPEG -i vid.avi -f 20 image2 image%04d.jpg

This would capture frames to a sequence of jpg images, resulting in an output such as:

image0001.jpg
image0002.jpg
image0003.jpg
etc.

The Example works fine from a normal command-line, but from within a batch-file, it gets mangled.

Thanks,
TimNever mind, I found it.

Just do a '%%' instead of a '%' and it's treated as a 'literal' when passed to the external program.

Tim



Discussion

No Comment Found