For testing, I have a USB flash drive mounted on E:. I opened E:\foo.png using IrfanView. That prevents the drive from being ejected. The 3rd party tool USB Safely Remove correctly identifies IrfanView as the blocking process:
Using PowerShell, how do I list all processes preventing a drive from being ejected?
I had a look at Sysinternals’ Handle. It lists a ton of processes, but exactly not the one that is locking E::
> handle.exe -nobanner E: | sls view
msedgewebview2.exe pid: 17320 type: Section E2C: \Sessions\1\BaseNamedObjects\43a8HWNDInterface:10564
msedgewebview2.exe pid: 17320 type: Section E30: \Sessions\1\BaseNamedObjects\43a8HWNDInterface:10564
