Running a Windows program in Batch mode

We keep getting asked this question, usually about JPGVideo, our standard answer is to suggest that the shareware version JPGAvi has this built in, therefore please buy it, after all we do need the money, not enough people are giving us donations!


But if you don't want to buy JPGAvi it is fairly easy, download this zip file, it contains a vbs script, a command line program, with source code, the exe program will start JPGVideo, press run and wait until it has finished before closing it.

The vbs script is simpler way of doing it, but will need editing for your system, just use any text editor such as Notepad.


The programs, deliberately have some magic number for the control IDs, this is to show a generic way of implementing this technique, These have been found using WinSPy (freeware), also the error trapping is very poor, look at the source code for more information.


This method does require some programming knowledge.

The basic concept is that any Windows program can be run in 'batch' mode by calling it via a separate program which will start the program and then close  it when it has 'finished', with JPGVideo I know that it has finished when 'Finished' is displayed, I then close JPGVideo. So to use the exe program, assuming that JPGVideo has been installed it the default directory, copy the following line, with the double quotes, and run in a Windows Console (DOS Box), in the directory you have installed RunJPGVideo.

RunJPGVideo "C:\Program Files\NDW\JPGVideo\JPGVideo.exe"

Generally speaking this command would be called by a batch file, probably automatically at a specific time, the batch file would probably rename the resulting AVI file and move the JPG files from the input directory.

The VBS file is just to show how 'easy' it is, the  .CPP source code for RunJPGVideo is supplied as well.

Have fun!

Custom Search