Monday, January 29, 2007

Floppy Drive Wizardry

As I mentioned in my last post, I like to create shims when I want to avoid redundant tasks. My latest project (a needed project for my mother-in-law) was to copy a box of old floppy disks onto a single CD. I ordered her a computer a few weeks ago and didn't get her a floppy drive with the system. The problem is that she still needs to be able to setup all of her old tax programs (1996 - 2005), which just so happen to be on oodles of floppy disks. Each year's set of programs consisted of ~9 floppy disks. I actually started doing this one by one in Total Commander, and I found myself making silly mistakes along the way. I was basically doing the same thing over and over:
  1. Read the label on the floppy drive
  2. Create a new folder with that name
  3. Insert the floppy disk
  4. Refresh Total Commander
  5. Select all files from the floppy
  6. Copy the files to the newly created folder
  7. Wait until files are all copied...
  8. Rinse and Repeat
This got redundant and I realized I had to give it my full attention. Otherwise I got side tracked while the floppy was copying to my hard drive and a lot of time was lost for each disk. Once I got back to the process, I had to remember where I was at. It was very error prone; sometimes I would copy the same disk twice, or overwrite a directory with a different floppy. It was becoming a mundane process and I was going insane 1.44 mb at a time. After about the 12th floppy disk I decided to take some time out and write a small utility app to help make this nightmare easier. I had about 80 more floppy's to go and this isn't the best way to do it...

I decided that each year's set of disks was really a "Disk Set", and each "Disk Set" had multiple floppy disks associated with it (ie. W2 Program (Disk 1), W2 Program (Disk 2), etc...).

I got out my pencil and paper and drew up a mock version of what a UI might look like, then after about 10 minutes, I opened up VS2005 and started building the dialog. Once I got all the controls in place, I just started writing the code behind the various controls. The code behind the buttons is ridiculously easy, and the productivity of the whole "floppy disk project" was increased 10 fold. I just described the disk sets (ie. created the directories), and clicked 'import'. Once the app starts, it notifies me when I need to switch disks and I just switch disks and click enter. I created the app (start to finish) in about 2 hours; there were lots of small glitches to fix and various interruptions.

Here it is if you're interested in seeing it:
http://www.hardbarger.com/lucnjen/floppywizard.zip

It works like this:

  • Define the 'temp' directory that all files will go
  • Create a disk set (ie. 1998 Tax Programs, 1999 Tax Programs, etc..)
  • Define the various disks in the disk set (ie. W2 Program, 1099 Program, etc..)
  • Begin the import of the disk set
  • Answer the prompts...
The program could easily be used to consolidate an old box of floppy's onto your hard drive. Just gather a bunch of floppy disks and separate them into logical groups. Once they're in their groups, just enter the name of each disk and click "Import". The app takes over and prompts on what disk to put in the drive next. It even comes equipped with a progress bar... one of the glitches I had was that I didn't know if it was copying or not, so...

If you decide to download it, please let me know what you think. :)

Shimmy Shimmy!!

No comments: