Avrdude: ser_open(): can't open device "\\.\COM2": Access Denied

I was working on my project and suddenly this happened. I checked and the COM2 port appears when I connect the Arduino, and it's not used by anything else. What should I do?

This happened all of a sudden, no updates, no change of board, first it worked, now it doesnt

"Access denied" implies rather heavily that something else has COM2 open. Check the serial monitor, serial plotter, another terminal program, a hung avrdude process... basically go through the usual suspects.

I disconnect the board, it doesn't appear in device manager, I connect it again, reappears, and it says nothing else is using the port

The error message would imply otherwise. But whether or not you check the usual list of suspects is entirely up to you.

I really did, even changed port, do I need to record and video and show you?

I even changed it to COM256, and still nothing

What Arduino? Did you by any chance had it unplugged and got the error msg after you plugged it in again?

Yes, I unplugged it and then plugged it again

nevermind, all it took was a reboot :man_facepalming: