I want to delete the file in one particular directory. I get error message while any file from that directory is opened.Is it posible to delete that file even it is open.
Printable View
I want to delete the file in one particular directory. I get error message while any file from that directory is opened.Is it posible to delete that file even it is open.
The file needs to be closed before you can delete it.Quote:
Originally Posted by danasegarane
What directory are you trying to delete it from and what is the error message that you receive?
I have manually created a directory like c:\files.
Ok. What is the error?Quote:
Originally Posted by danasegarane
If you manually created the directory, then after it has been created it is empty. How does it get files in it?
In the command click event I am copying(file system object) a file from path c:\ to c:\files. During the process when I use the kill command to delete all the files in the folder. While doing so if any files accidently opened from the directory it produces a error message command failed in the copy method
You can't delete a folder that has open files in it. Close the files first.
If you are trying to delete the files from the source folder once they have been copyed to the target folder (thus, performing a "move") then the best way would be to first do the complete copy. When the copy is done, your program will no longer have a connection to the file, so now you can go back and delete them.Quote:
Originally Posted by danasegarane
Post the code you have we will help you to solve the problem.