This is a nice little program! I especially like that you’ve included the arguments to avrdude in the .txt file, which lets you expand it later without needing to rewrite it.
Here are a couple of tips for those commenting:
1. There is a “devices.txt” file in the program’s working directory. This text file contains the names of the boards, the processor types, the bootloader protocol, and the baud rate for programming.
Example: Uno(ATmega328);m328p;stk500;57600;
To program an Arduino Leonardo, you need to do some extra work. Add the following line to devices.txt:
Leonardo(32U4);atmega32U4;avr109;57600
Then replace avrdude.exe and avrdude.conf with the ones from the latest Arduino IDE.
You’ll also need to change any instances of “stk500” in devices.txt to “stk500v1,” and you’ll need to put the Leonardo in bootloader mode before starting the upload. You can do this pretty easily by toggling the reset line low (just press the button!) on the Leo before uploading.
Perhaps in a future version, the author can add in the Leonardo trick – open the COM port at 1200 baud and then close it again. That resets the AVR and puts it bootloader mode for 8 seconds.