AlexPi
AlexPi

Reputation: 586

How to find out what has an EXE open in windows

When you try to delete a file in Windows Explorer, and that file is in use, it brings up a dialog saying File In Use and it proceeds to give you the file name that has the file open.

For example,

Example

I've seen hacks involving kernel drivers, but if Windows Explorer can do it, then there must be an easier way.

What is the best and easiest way to get this information?

Upvotes: 3

Views: 469

Answers (1)

RRUZ
RRUZ

Reputation: 136391

Starting with windows vista you can use the IFileIsInUse interface, if you want support older versions of windows you can use the NtQuerySystemInformation, NtQueryInformationFile and NtQueryObject WinApi functions, for more infomation about this topic check my answer on this question.

Upvotes: 6

Related Questions