Error while uploading to board

hello everyone
i am working on my graduation project with arduino mega 2560 and i have problem while uploading my sketch to the board, the unusual thing is that when i verify the sketch the software gives me DONE COMPILING!! which i guess means everything is okay but for the uploading to board it shows this error message:

Arduino: 1.6.7 (Windows 7), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"

Sketch uses 7,568 bytes (2%) of program storage space. Maximum is 253,952 bytes.
Global variables use 350 bytes (4%) of dynamic memory, leaving 7,842 bytes for local variables. Maximum is 8,192 bytes.
avrdude: ser_open(): can't open device "\.\COM3": The system cannot find the file specified.

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

Problem uploading to board. See for suggestions.

This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.

i would appreciate your help :slight_smile:

Simple, COM3 doesn't exist. That's exactly what the IDE tells you. Select the right port and you're all set.

vrdude: ser_open(): can't open device "\.\COM3": Access is denied this is what mine tells me

Access denied is 99% of the time it's used by something else. Only one thing/program can access a port at a time. Did a restart?

In tools -> port, check that COM3 exists. If it is not listed, you have selected a port that doesn't exist, and your error is expected.

Are the drivers installed correctly? Many clones use a CH340G serial chip (check the chip near USB port), instead of a 16u2. In that case, you must install the CH340G drivers (google for em - it's something called CH341SER.exe, super engrishy installer, but works great). Usually in this case nothing shows up, but one person in the past reported getting weird errors like that from it.

There's a bug in 1.6.8 that causes windows users to get access denied (among other problems) but you're using 1.6.7....

Finally, it is possible that some other piece of software on your computer is stupid and attempts to connect to any serial port it sees, assuming that it's some peice of hardware that that software is meant to work with (I've heard of people's systems connecting to any serial port that it sees and sending modem commands to it, assuming it's a phone modem).