Fletch219839
IS-IT--Management
I am using the following code to delete files.
Const DeleteReadOnly = True
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.DeleteFile("Q:\Company\Forms\*.PTR"), DeleteReadOnly
The code works great as long as their is a PTR file in the folder to delete.
If their is no PTR file in the folder the script generates an error.
Can someone tell me how to make the script stop giving errors if the file is already deleted.
Const DeleteReadOnly = True
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.DeleteFile("Q:\Company\Forms\*.PTR"), DeleteReadOnly
The code works great as long as their is a PTR file in the folder to delete.
If their is no PTR file in the folder the script generates an error.
Can someone tell me how to make the script stop giving errors if the file is already deleted.