Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Finding the process(s) that have locked a file

Finding the process(s) that have locked a file

Scheduled Pinned Locked Moved C#
jsonhelptutorialquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    MrEyes
    wrote on last edited by
    #1

    Does anybody know of any way to find out which application/process has locked a file? As an example, you have a file called widgets.txt and when you try and delete it you get a message along the lines of "Cannot delete widgets.txt, there has been a sharing violation, the source or destination file may be in use". The problem is this message doesnt tell you what it actually holding a handle on the file. I am currently working under the assumption that there is something in the Win API that I can call to get this information, however I am currently at a loss to what it is.

    R 1 Reply Last reply
    0
    • M MrEyes

      Does anybody know of any way to find out which application/process has locked a file? As an example, you have a file called widgets.txt and when you try and delete it you get a message along the lines of "Cannot delete widgets.txt, there has been a sharing violation, the source or destination file may be in use". The problem is this message doesnt tell you what it actually holding a handle on the file. I am currently working under the assumption that there is something in the Win API that I can call to get this information, however I am currently at a loss to what it is.

      R Offline
      R Offline
      RSArockiam
      wrote on last edited by
      #2

      check this article and try to use that http://www.codeproject.com/system/Task_Manager_Extension.asp[^]

      Regards R.Arockiapathinathan

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups