I'm writing a program that copies a file over another. Either of the files could be in use at any time by others (momentarily). I want to ensure that I won't get permission denied if one of the files is in use. My thought was a loop that waits for the file(s) to close(if needed), then copies it. How do I check if the file is in use
Thanks in advance for your help!

permission denied runtime error 70
sk4130
I used a try catch as nbrege suggested. I had never heard of this before (I'm some what new to this). I set up a loop that attempts to check the file 100 times, each time if the try catch gives me an error saying the file is in use, I try again.
While retry Tryretry =
Falseretries = retries + 1
FileCopy(Location &
"on.vbs", Location & Room.Name & "_01.vbs") Catch ex As System.IO.IOException If retries > 100 Thenretry =
False Elseretry =
True MsgBox("File in use error.") End If End Try End WhileThanks again for your help.
5982
esp123
http://msdn2.microsoft.com/en-us/library/8tbkaxz5.aspx
Narayanan Dayalan
Sorry for my ignorance, but what is a try...catch
Najeeb
Thanks! I actually just got it working. (I should have looked in help before my last response, sorry.)
rmini
Care to tell us how you achieved the correct result. (Others may find it useful)