Checking weather the File is available or not, if available delete theFile in QTP

January 24, 2010

strDirectory="E:\"
strFile="test.txt"
Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FileExists(strDirectory & strFile) Then
Set objFile = objFSO.Getfile(strDirectory & strFile)
objFile.delete ()
End if

You Might Also Like

0 comments