How to check if file is open on Windows XP?

Tim Golden mail at
Sat Jun 20 10:39:10 CEST 2009

Dudeja, Rajat wrote:
> Hi,
> I'm looking for a fascility that can check if the file is open on Windows XP 
> and if the file is open (say a notepad file is open), I want to close that file 
> (i.e the notepad application)

In short, this is far trickier than you might imagine.
It's come up a number of times on the Python / Python-win32
lists. A recent thread is here:

But if you simply Google for things like: sysinternals handle

You'll get a bunch of hits asking / answering the same thing.


More information about the Python-list mailing list