Example -
Below Code will rename a file strFile to strRename in QTP
Set FSO = CreateObject("Scripting.FileSystemObject")
strFile = "C:\original.txt"
strRename = "C:\new.txt"
If FSO.FileExists(strFile) Then
FSO.MoveFile strFile, strRename
End If
Set FSO = Nothing
This is how we can rename a file in QTP
Below Code will rename a file strFile to strRename in QTP
Set FSO = CreateObject("Scripting.FileSystemObject")
strFile = "C:\original.txt"
strRename = "C:\new.txt"
If FSO.FileExists(strFile) Then
FSO.MoveFile strFile, strRename
End If
Set FSO = Nothing
This is how we can rename a file in QTP
No comments:
Post a Comment
Please Leave your reply. We value your feedback and inputs