Error while doing upload at the begining

Sketch uses 4542 bytes (14%) of program storage space. Maximum is 32256 bytes.
Global variables use 808 bytes (39%) of dynamic memory, leaving 1240 bytes for local variables. Maximum is 2048 bytes.
avrdude: ser_open(): can't open device "\.\COM4": Access is denied.

Failed uploading: uploading error: exit status 1

Kindly help me to resolve it. Thanks in advance.

What OS?

Does COM4 disappear from the IDE when you disconnect the board?
What does Windows device manager think of your board?

Which board; looks like Uno or Nano.

Does your MAC use the notation COM for ports :rofl:

I get several names. I think I have seen COM, but not right now, so maybe not. My post should have been is he using Unix.

COM is Windows; Linux would be /dev/tty*.

Senior moment.

windows 10

I searched the forum for the same error (happens all the time to new users) and here is the solution.
https://forum.arduino.cc/t/sudden-access-denied-message-between-uploads-ide-2-3-4/1355416