Fix “avrdude: ser_open(): can't open device \\.\COM3: The system cannot find the file specified”
The COM port selected in the IDE doesn't exist any more. Replug the board, re-select the port, and check the driver and cable.
Community draft — report a mistake
What you see
Sketch uses 924 bytes (2%) of program storage space. Maximum is 32256 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 2039 bytes for local variables. Maximum is 2048 bytes.
avrdude: ser_open(): can't open device "\\.\COM3": The system cannot find the file specified.
Failed uploading: uploading error: exit status 1Sketch uses 924 bytes (2%) of program storage space. Maximum is 32256 bytes. Global variables use 9 bytes (0%) of dynamic memory, leaving 2039 bytes for local variables. Maximum is 2048 bytes. avrdude: ser_open(): can't open device "\\.\COM3": The system cannot find the file specified. Failed uploading: uploading error: exit status 1
avrdude was told to open COM3, and Windows says no such port exists. The board is unplugged, on a different port number, or not recognised as a serial device at all.
Re-select the port after every replug. If no port appears, it’s the cable or driver, not avrdude.
Quick fix — try in order
- 1
Re-select the port after plugging in
Tools → Port. The number may have changed (COM3 → COM5) after a replug, a different USB socket or a driver update.
- 2
Watch which port appears
Unplug the board, open Tools → Port, plug it back in, and see which entry is new. That is your board.
- 3
No new port at all? Fix cable or driver
A charge-only cable or a missing CH340 driver means Windows never creates a port. See COM port not showing and CH340 driver not installed.
- 4
Port disappears during upload
If it was there a moment ago, the board reset and dropped off USB — a short circuit on 5 V, a motor or relay on the board's supply, or a worn USB socket.
Why it happens
“Access is denied” instead
Then the port exists but another program has it open. Close Serial Monitor and other serial apps — see port busy / access denied.
Leonardo, Pro Micro
These boards change COM number between sketch and bootloader. The IDE handles it, but if your sketch crashed, double-tap RESET and upload quickly — see butterfly_recv.
Board-specific notes
Arduino Uno R3 (genuine): Shows as “Arduino Uno (COMx)” with no extra driver on Windows 10/11. Clones show as “USB-SERIAL CH340 (COMx)”.
Drivers — official sources only
Did this fix it?
Thanks — that helps us keep this page right.