Melzi v3b firmware flash
I have had trouble before not using spacing between arguments. I think no spacing between -b and 57600 is causing the problem. Try

avrdude -p m1284p -b 57600 -c arduino -P COM%x% -e -U flash:w:%filename%.hex