Problem solved, can close! COM Port errors trying to upload sketch

Problem solved! Same solution as Sonra in their post.


Hello, I'm trying to upload a compiled sketch to a replacement board for a ROBO R1 3D printer. When I try to upload I get the following errors:

avrdude: ser_open(): can't set com-state for "\.\COM4"
avrdude: ser_drain(): read error: The handle is invalid.

The board I'm uploading to is a RepRapDiscount MEGA 2560.

I have tried both the ROBO and Marlin sketchbooks with no success. I have also verified that COM4 is where the board shows in Device Manager.

This is my first time using Arduino so I'm in way above my head trying to figure out what is happening here. Any help MUCH appreciated!