Sketches compile but will not upload

I am having trouble uploading sketches using several different kinds of boards and many different sketches.
Upload success is intermittent with the following error message:

“the selected serial port Failed to execute script esptool does not exist or your board is not connected”

Arduino: 1.8.12 (Windows 10), Board: “M5Stack-Core-ESP32, QIO, 80MHz, Default, 921600, None”

Sketch uses 352553 bytes (26%) of program storage space. Maximum is 1310720 bytes.
Global variables use 17596 bytes (5%) of dynamic memory, leaving 310084 bytes for local variables. Maximum is 327680 bytes.
C:\Users\Owner\AppData\Local\Arduino15\packages\esp32\tools\esptool_py\2.6.1/esptool.exe --chip esp32 --port COM4 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size detect 0xe000 C:\Users\Owner\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4/tools/partitions/boot_app0.bin 0x1000 C:\Users\Owner\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4/tools/sdk/bin/bootloader_qio_80m.bin 0x10000 C:\Users\Owner\AppData\Local\Temp\arduino_build_965858/HelloWorld.ino.bin 0x8000 C:\Users\Owner\AppData\Local\Temp\arduino_build_965858/HelloWorld.ino.partitions.bin
esptool.py v2.6
Serial port COM4
Traceback (most recent call last):
File “esptool.py”, line 2959, in
File “esptool.py”, line 2952, in main
File “esptool.py”, line 2652, in main
File “esptool.py”, line 222, in init
File "site-packages\serial_init
.py", line 88, in serial_for_url
File “site-packages\serial\serialwin32.py”, line 62, in open
serial.serialutil.SerialException: could not open port ‘COM4’: WindowsError(5, ‘Access is denied.’)
Failed to execute script esptool
the selected serial port Failed to execute script esptool
does not exist or your board is not connected

I am new to all this and I am sure I am missing something simple.
Thanks