Cannot upload code to mega 2560

I'm no programming expert.. Thus need some help on this.

Whenever I tried to upload my code to my Mega 2560, it'll have an error saying:

avrdude: ser_open(): can't open device "\.\COM4": The system cannot find the file specified.

avrdude: ser_drain(): read error: The handle is invalid.

Problem uploading to board. See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.

Any help will be appreciated.. :slight_smile:

What version is your OS (Win7, 8, 10 or ....)? Which version of IDE?

Which com port in Windows device manager? Are there multiple ports in the IDE's port menu?

Win 7 home premium 64bit, only 1 port (COM4)

There were 4 questions; only two answers :wink: And did you follow the link that the error message provided?

I will not be able to help due to insufficient knowledge in this area but the above are general questions.