Avrdude: ser_open(): can't open device "\\.\COM5": Access is denied

I used to use platformio with VScode on my W10 desktop until last year and I did not have any problems with uploading.
Today I wanted to start a new project and after starting VScode it installed it’s latest updates.
Now I find that I cannot upload a sketch anymore.
I always get the titled message, even after a Windows reboot and running only vscode.
I even tried to run VScode as administrator, but it did not help either.
The serial monitor also gives an error:

could not open port ‘COM5’: could not open port ‘COM5’: PermissionError(13, ‘Access is denied.’, None, 5)

I then started the Arduino IDE and there was no problem uploading a sketch to COM5.
Thus, the port is correct and avrdude from the Arduino IDE can talk to it without problems.
My version of VScode is 1.64.2 and platformio is v2.4.2.

Is there a simple way to get the device access?

What’s the target board?

target is an arduino pro mini

I’ve seen this problem pop up a few times now here in the forum, but I’m never able to reproduce it. Does the procedure at ESP32 & could not open port 'COM5': PermissionError(13, 'Access is denied.', None, 5) - #13 by yvesdelbrassine help?

Thanks for pointing me in the right direction.
I exchanged my pro mini with an arduino nano and I can upload.
Thus, it seems that the USB/serial adapter which is required for the pro mini creates the problem
It still puzzles me though that the arduino ide has no problems talking to the usb device.

Update: The FTDI adapter with the upload problem was an original FT232RL chip.
I now have replaced it with a cheap CP2101 adapter and I can upload with that.
Strange things happen.