File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Linux / UNIX and the fly likes Finding PID of a file in Windows Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "Finding PID of a file in Windows" Watch "Finding PID of a file in Windows" New topic

Finding PID of a file in Windows

Allan Santana

Joined: Apr 28, 2007
Posts: 3
I need to know how I can get the PID of a process that locking a file in the Windows(the same of command fuser in Linux). I need this PID to kill the process automatically and after delete this file.
Thank you very much.
Stefan Wagner
Ranch Hand

Joined: Jun 02, 2003
Posts: 1923

And why do you ask in the linux/unix-section?

PID in Windows lock files - didn't I get your question?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17417

Originally posted by Stefan Wagner:
And why do you ask in the linux/unix-section?

Because Windows people don't know what the "fuser" command is?

Seriously, though, there are Windows utilities for this kind of stuff, but unlike Linux, they aren't part of either the base distro or Microsoft developer kits. I recommend Google, since I've tried to avoid using Windows enough that I no longer remember their names.

BTW, "bumping" a query (especially after only 2 hours!) isn't considered polite on JavaRanch. The way things work around here, if SOMEONE hasn't answered within a day or 2 and you're not using some sort of fictitious name, we probably don't know the answer. Fortunately, we know LOTS of answers!

An IDE is no substitute for an Intelligent Developer.
I agree. Here's the link:
subject: Finding PID of a file in Windows
It's not a secret anymore!