Hi all,
In my application, i written a code to delete a folder.
Here is the code: Directory.Delete(folderpath, true);
The problem is that: If some one is opened or using the file in the same folder, It gives me exception.
Is there any possibility to delete a folder even if some one using the files in the folder.
Thanks allot!
Darma
Loading
VulpesPosted May 23, 2013, 5:55 AM
However, You should be able to find out who has a file open on a network share using the NET FILE command line utility:
http://technet.microsoft.com/en-us/library/bb490702.aspx
darma tejaPosted May 23, 2013, 5:07 AM
Thanks allot for the reply.
Is there any possibility to know on which computer it is opened or who is opened?
Thanks
Darma
VulpesPosted May 23, 2013, 4:59 AM
When a file is open, the operating system places a lock on it so that it can't be deleted.
The operating system will also prevent a folder from being deleted until all files in the folder have been, or can be, deleted which is not therefore possible here.