[ACCEPTED]-Identify process using a file-wmi

Accepted answer
Score: 25

You can use handle.exe from Sysinternals.

Something like:

> handle /accepteula C:\path\to\directory
...
program.exe           pid: 1234   type: File           2E4: C:\path\to\directory
...

Thanks to https://stackoverflow.com/a/599268/367916 .

0

Score: 10

You could use Process Explorer from Microsoft

  1. Download & unpack & run Process Explorer
  2. Click Find menu and then click Find Handle or DLL... or press CTRL + F
  3. Copy and paste path to locked folder of file
  4. Click Search, you can kill process from main Process Explorer window

0

Score: 4

If you can limit yourself to new enough 2 versions of Windows, the Restart Manager 1 can tell you which process has a particular file open.

Score: 2

Because of the way Process Explorer works, I 5 suspect that what you need to look for is 4 a way of finding the file handles attached 3 to a given process, and that you'll have 2 to pull that list for each process in the 1 system and look for your file within it.

Score: 0

I don't know in Windows, but somebody might 4 find useful to know that, in Linux, you 3 can use the lsof command, or just search through 2 the folders /proc/PROCESS_ID/fd and see 1 what process has opened the file.

Score: 0

WhoLockMe is a nice right click windows explorer 1 extension.

Score: 0

This article might be helpful to you.

It appears 3 you are forced to search through the list 2 of files for each process on the system 1 using undocumented functions in ntdll.dll.

More Related questions