Skip to content

Programmatically View/Close Open Files in Network Folder

Shawn Leenerts

Asked May 15, 2014, 9:18 AM EDT2 answers
Share
LinkedInX
I've got an application designed in VB.Net and I'm using part of it to programmatically rename folders, but the user gets an error if someone has a file open from that folder. Is there a way to view all of the files that are open within a specific network folder? If so, is there a way to programmatically close those files, or at least see who has the files open? Thanks for any help you can provide.

2 Answers

Know the answer? Post it. Somebody with the same question will find it here.

  • Mahesh Chand
    0
    Catch exception on File.Open method and if IOException occurs, you know file is already opened.
    0
  • 0
    Thanks for the response Mahesh Chand!  But say I have a network folder with 5 files in it, and someone has one file (a PDF) open, so when I try to programmatically rename the folder I get an error... is there a way to see which of the 5 files is open and who has it opened?
    0