ECHO OFF REM BATCH FILE REM Takes a picture, moves the microscope a fixed distance, takes another picture... REM REM Uses zstage.exe to move the microscope REM Uses a DOS command to take a picture, e.g. PSRemoteTest.exe from www.breezesys.com for Canon Powershot. REM REM include path to zstage.exe and PSRemoteTest.exe SET PATH=C:\zstage;C:\Program Files\BreezeSys\PSRemote\PSRemoteTest REM COM Port of z stage SET COMPORT=COM3 REM Number of pictures to be taken SET PICTURES=27 REM Vertical distance to move SET MOTION=2560 SET /A MOTIONUP=-%MOTION% REM Move stage, take pictures FOR /L %%X in (1,1,%PICTURES%) DO (zstage %COMPORT% %MOTIONUP% & PSRemoteTest.exe) REM Go back to origin SET /A MOTIONDOWN=%PICTURES%*%MOTION% zstage %COMPORT% %MOTIONDOWN% REM NOT TRUNCATED