CommandCam is a simple and easy to use command line webcam image grabber for Windows. It captures a single image from a webcam and stores it in a bitmap file. CommandCam is ideal for use in batch files and other situations where you want a very simple way to automate image capture. CommandCam uses Microsoft’s DirectShow API to access webcams, so it should work with most USB cameras.
CommandCam (the source code and the executable version) are published under the GNU General Public License (version 3).
More information