Digital Camera Auto-Unload
April 28, 1998
My Nikon Coolpix 100 has been getting a workout ever since I received it for Christmas in 1997. I have taken over a thousand photos with it and it seems like Im taking them even faster lately. Which leads to the most pressing issue most people with a digital camera are likely to face how to unload the camera quickly and get back into action. You see, digital cameras can take an unlimited number of pictures, they just cant store them inside themselves in very large numbers.
The Coolpix 100 is a camera on a PC Card, so for users with a notebook computer, its a quick matter to plug it in and work with the files. Theres no special software required for Windows 95. Its just recognized as an "IDE/ESDI Hard Disk Controller". But you still have to figure out what to do with the image files it creates. Lately I just copy everything onto the hard drive. After making the copies, I delete the files from the camera and pull it from the slot to go on shooting. I rename the files later to give them meaningful titles.
Since these steps are pretty much the same every time, its an ideal operation to have the computer do for me. In fact, theres a great mechanism in Windows 95 that makes it a hands-off operation the Autorun.inf file.
If you have inserted almost any recent CD-ROM into a Windows 95 machine, you have probably experienced the autorun feature. Music CDs start playing music, program disks start to run. Because the operating system notices the insertion of a new disk, it looks for the presence of an Autorun.inf file in the root of the newly-mounted drive and take its instructions to automatically start some program. Its not confined to CD-ROMs though. Any removable drive, even a floppy diskette, can contain an Autorun.inf file and its easy to create one because its written in plain ASCII text.
The only two lines needed for an Autorun.inf file to work are a section heading and a line identifying the program to open. The example below came from my Delorme Street Atlas USA 5.0 CD-ROM:
open = Util\autorun.exe
icon = Program\bin\sa5.ico
shell\install = &Install
shell\install\command = setup.exe
Only the first two lines are really necessary, and the program to call from the "open =" line can be any file that Windows 95 can run. It doesnt need to be an executable, it can be a batch file, and thats what makes this such a quick and simple programming trick. You dont need a compiler. I used just an editor and a freeware utility that extends the batch command language.
Oh yes, another trick that helps is that you can point to the batch file on any drive on the system, so you dont have to waste the cameras limited storage on these programs. Only the Autorun.inf file sits on the camera, and its very small.
So here are the pieces you will need to make this work.
AUTORUN.INF (copy this file to the camera)
COOLPIX.BAT (copy this file to C:\)
The program, STRINGS.COM must be somewhere on the path for this batch file to work. You can find STRINGS.COM online in ftp://ftp.zdnet.com/pcmag/1992/1222/strings.zip. You will also need to create the C:\COOLPIX directory before you use this for the first time.
I used the features of STRINGS.COM to come up with subdirectory names based on the current date and time. The purpose of creating a unique subdirectory for every insertion of the camera is to avoid overwriting any existing images. The Coolpix 100 always names the image files CCM0001.JPG, CCM0002.JPG, etc., so unless you take the time to rename files every time you unload, there are bound to be duplicates.
Another feature that helps this batch file work is that even though Autorun.inf calls for a program on C:\ to run, the default stays with the camera, so we can determine which drive letter the Windows 95 operating system has assigned to it. That makes it simple for the XCOPY and DEL commands to do their work.
Now that the Autorun.inf exists, I wouldnt want it any other way. This has sped up my time with the camera inserted in the computer. With the camera full of 21 images shot in "fine" mode, it took my IBM ThinkPad 365XD (a 133 MHz Pentium notebook computer, running Windows 95 OSR2) only 28 seconds from insertion to removal of the camera.
Its likely this method would work with other cameras. Any storage device that appears to the system as a removable disk can carry an Autorun.inf file. So Smart Media, flash cards, or other media used by a number of other cameras could be quickly unloaded this way.
I know I could run into trouble one day if I ever run low on hard disk space. This batch file doesnt bother to check that theres enough room to fit the images from the camera before it runs, but for today Ive got plenty of capacity and I may work out a size check for a future enhancement. For now, Im too busy shooting pictures.