Just keep the "On Error Resume Next" statement in your script, but add the following 4 lines below the FSO.DeleteFile method.
On Error Resume Next
For Each file In objFsoFolder.files
wscript.echo file
FSO.DeleteFile(file)
If Err Then '<-- ADD THE FOLLOWING LINES
wscript.echo "Unable to delete file '" & file & "'. The file is currently locked by another process."
Err.Clear
End If
Next
Main Topics
Browse All Topics





by: AzraSoundPosted on 2006-10-23 at 12:36:33ID: 17791033
If the file is locked does it actually let you delete it? Also, by locked do you mean exclusively opened by another user/process? I wouldn't imagine it let you delete it otherwise.