Home / Microsoft / Microsoft Windows / Windows NT / 2000 / Batch file literals '%'
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] - (Bottom) Print
Author Topic: Batch file literals '%'  (Read 1544 times)
triola
Topic Starter
Newbie



Posts: 2


« on: October 16, 2009, 12:18:14 PM »

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,
Tim
IP logged
triola
Topic Starter
Newbie



Posts: 2


« Reply #1 on: October 16, 2009, 02:23:56 PM »

Never mind, I found it.

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

Tim
IP logged
Pages: [1] - (Top) Print 
Home / Microsoft / Microsoft Windows / Windows NT / 2000 / Batch file literals '%' « previous next »
 


Login with username, password and session length

Old Forum Search | Forum Rules
Copyright © 2010 Computer Hope ® All rights reserved.
Powered by SMF 2.0 RC3 | SMF © 2006–2010, Simple Machines LLC
Page created in 0.081 seconds with 21 queries.