Windows 如何获取正在使用目录的进程?

Windows 如何获取正在使用目录的进程?,windows,process,resources,Windows,Process,Resources,我想删除操作系统win10中目录d:\\tmpdata中的所有文件 import shutil shutil.rmtree('d:\\tmpdata') 它遇到了如下问题: PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'd:\\tmpdata' 尝试获取正在使用资源的进程--directroyd:\\tmpdata:

我想删除操作系统
win10
中目录
d:\\tmpdata
中的所有文件

import shutil
shutil.rmtree('d:\\tmpdata')
它遇到了如下问题:

PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'd:\\tmpdata'
尝试获取正在使用资源的进程--directroy
d:\\tmpdata

tasklist  | findstr  'tmpdata'


找不到进程,如何获取正在使用目录的进程?

尝试内置软件资源监视器。搜索resmon.exe。启动程序,选择CPU,然后选择关联的句柄-键入文件夹路径,然后查看使用它的内容

tasklist #run it only ,search by eye.