Bookmark Topic Watch Topic
  • New Topic

Finding PID from file in Windows

 
Allan Santana
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hi,
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.
 
Peter Chase
Ranch Hand
Posts: 1970
  • Mark post as helpful
  • send pies
  • Report post to moderator
You don't make it clear whether you are trying to do this from a Java program or from the command line.

If from a Java program, there are no pure Java solutions to this. You would need to use either native Windows code (JNI) or to run an external native program via Runtime.exec().

If you just want to do it from the command line, go look at Sysinternals' tools.
 
Joe Ess
Bartender
Posts: 9361
11
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please do not post the same question more than once. It causes confusion and duplication of effort as the community tries to help everyone.
 
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!