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. Delete Directory

Delete Directory

Scheduled Pinned Locked Moved C#
questionhelp
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.
  • R Offline
    R Offline
    Radu Sorin
    wrote on last edited by
    #1

    I have a problem deleting a directory, when that directory is already open by another application (like WExplorer, or TCommander). I get the well known exception ".. the process cannot access the file because is used by another application". How can I get around this ? (TCommander as far as I've seen can delete a dir, even if the dir is open by explorer, so something can be done...). Thanks in advance to all that may give me some info on this problem.

    T 1 Reply Last reply
    0
    • R Radu Sorin

      I have a problem deleting a directory, when that directory is already open by another application (like WExplorer, or TCommander). I get the well known exception ".. the process cannot access the file because is used by another application". How can I get around this ? (TCommander as far as I've seen can delete a dir, even if the dir is open by explorer, so something can be done...). Thanks in advance to all that may give me some info on this problem.

      T Offline
      T Offline
      Thomas Stockwell
      wrote on last edited by
      #2

      You would have to setup a try catch statement to catch when the exception occurs and see what the program can do to fix the issue, and if it can't you could possibly tell the user which program is causing the error and needs to be closed.

      Regards, Thomas Stockwell Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. Visit my homepage Oracle Studios[^]

      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