I was gonna suggest On error resume next.
lets see, i have this code
and well, i cant do On Error Resume next, because it just skips the entire delete. There are some files in the directory i am deleting files from that are being used by another process. how would i make it skip those files?Code:Dim f() As IO.FileInfo Dim FD As IO.FileInfo f = dir.GetFiles For Each FD In f FD.Delete() Next Dim da() As IO.DirectoryInfo Dim d1 As IO.DirectoryInfo da = dir.GetDirectories For Each d1 In da DeleteDirContents(d1) Next End Sub
and btw..i didnt just copy paste this
I was gonna suggest On error resume next.
could u be clearer in what u are asking? Specifically here -->"There are some files in the directory i am deleting files from that are being used by another process." I think i can help u but u need to be clearer so i can help u better
hmmm, when you try to modify or read files being run by windows, it comes with an error that another program is using it, so the delete will just skip it all together.
im trying to skip the files that it cannot delete. even if i dont know the name of the file.
like say index.dat is being used by another process. i want it to ignore that file even if i dont tell it the name of the file in the code
im pretty sure C++ can do that, i dunno about VB sorry.