1. Home
  2. Docs
  3. Documentation of ImageGrab
  4. How to Use
  5. Command Line

Command Line

To use ImageGrab in command line, many “switches” are available. You can find a list of them in the Help panel by typing F1 or by clicking on the Help button on the toolbar or the menu command ?/Help.

For example to open a file in ImageGrab we find the OpenFile command whose switch is o. It is used with the syntax /o =”File” and therefore the command line will be for example

"c:\Program Files (x86)\ImageGrab\imagegrab_61en.exe" /o="g:\films\Manhattan.mkv"

Some commands which are flip-flops have several syntaxes, for example to activate the inlay we have the command InsertTextOn which has the syntaxes /i +i or -i.

The first /i has the effect of changing the current mode: if there was no inlay it will be activated, and otherwise it will be deactivated.

The second +i activates the inlay (whatever the state of ImageGrab); the third -i disables the inlay whatever the state of ImageGrab).

Be aware that you shall not add blank spaces after /, + or neither before or after =. All texts are in double quotes.

You can add several switches in the same command line, separating them with a space, for example:

"c:\Program Files (x86)\ImageGrab\imagegrab_61en.exe" /o="g:\films\Manhattan.mkv" /StrPos="0:25:00:00" +i /is /g /nam /g /nam /g /nam /g

This line opens the file “g:\films\Manhattan.mkv” , advances to the 25th minute of the film, activates the inlay, defines it as inlaying the timestamp, and captures an image. Then each switch /nam advances one minute in the film and the switch /g then captures the image.

When the command line is long we can write it in a batch .bat file which we then launch with command.com. Be careful, if you use the character % in a string, then it must be doubled in the .bat file and only there.

For example to make a personalized insertion of the file name with its extension, we could use the switch /p1="%F%E" jointly with /ip and +i. But if it is in a batch file we will write /p1="%%F%%E"

Was this article helpful to you? Yes No 1