@echo off :: Designed to run QV-3000EX as a web cam from the command line :: Maurice Delaney 26 Oct 2000 maurice.delaney AT gmail DOT com for %%l in (wait 1min cam) do if .%1==.%%l goto %1 for %%a in (1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20) do if .%1==.%%a goto arg1good goto help :arg1good if .%2==. goto arg2good for %%a in (1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20) do if .%2==.%%a goto arg2good goto help :help echo Syntax: %0 [arg1] ([arg2]) where case-sensitive arg can be: echo arg1: 1/20, time between photos in minutes echo arg2: - number of photos to take, blank for endless? echo. goto end :arg2good set l= for %%c in (1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20) do call %0 wait %%c %1 %2 set l= if .%2==. %0 %1 goto end :wait if .%l%==.end goto %l% echo Cycle %2 of %4 ... set t= for %%w in (1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20) do call %0 1min %%w %3 set t= :takephoto %comspec% %0 cam Aa 1 %comspec% %0 cam Bb 4 :usb ::call %0 cam Mm 5 ::dir f:\DCIM\*.jpg /s ::copy f:\DCIM\*.jpg . ::ftp script :usbrec ::call %0 cam Mm 5 :: stops the rest of the cycles - if %3 blank, never true if .%2==.%4 set l=end echo.%l% set l= goto end ::============================ subroutines ============================ :1min if .%t%==.end goto %t% echo Waiting %2 min of %3 ... if %OS%.==Windows_NT. C:\WinNT\choice.com /t:y,%3 > nul if not %OS%.==Windows_NT. C:\Windows\Command\choice.com /t:y,%3 > nul :: stops the rest of the waits if .%2==.%3 set t=end echo.%t% goto end :cam ::echo %2, %3 ::pause :: initialise COM1 port settings mode com1: baud=9600 parity=n data=8 stop=1 > nul echo "%2"> com1 if %OS%.==Windows_NT. C:\WinNT\choice.com /t:y,%3 > nul if not %OS%.==Windows_NT. C:\Windows\Command\choice.com /t:y,%3 > nul goto end :end