The operation cannot be completed because the file or folder is being used by another program. Close the file or folder and try again.
You’ve probably encountered this issue on Windows when attempting to delete or rename a folder or file — the system warns that the file is in use.
To identify which Windows program is using the file or folder, you can input the file path (handle) into the System Resource Monitor to find the program that’s holding it.
For users who prefer command-line operations, efficiency is key. We recommend using the official Microsoft tool Sysinternals Handle.
Download and Extract the Tool
Download Link:
https://learn.microsoft.com/en-us/sysinternals/downloads/
Usage Example
handle64.exe "C:\Target Path" # Query which process is holding the file

After extracting the files, simply place them in a suitable location, for example:
D:\program\selfTools\other\SysinternalsSuite
Add the path to the system PATH environment variable. This allows you to directly type handle
in the terminal without needing to specify the full path to handle.exe
.

We use Handle to find the process that is occupying this folder:
D:\program\selfTools\other\SysinternalsSuite> .\handle.exe "D:\projects\SimpleTools\win-tools\whoUseFile"
Nthandle v5.0 - Handle viewer
Copyright (C) 1997-2022 Mark Russinovich
Sysinternals - www.sysinternals.com
explorer.exe pid: 28384 type: File 7604: D:\projects\SimpleTools\win-tools\whoUseFile
explorer.exe pid: 28384 type: File 83D4: D:\projects\SimpleTools\win-tools\whoUseFile
devenv.exe pid: 52696 type: File 4C: D:\projects\SimpleTools\win-tools\whoUseFile\build
devenv.exe pid: 52696 type: File BF8: D:\projects\SimpleTools\win-tools\whoUseFile\build\.vs\whoUseFile\v17\Browse.VC.db-wal
devenv.exe pid: 52696 type: File 101C: D:\projects\SimpleTools\win-tools\whoUseFile\build\.vs\whoUseFile\v17\Browse.VC.db-wal

From the log, we can see that “trae” and Visual Studio are the main programs locking the file. Close them, and then you can delete the “whoUseFile” folder without encountering a pop-up error.