Micro Focus QTP (UFT) Forums
File system object - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: File system object (/Thread-File-system-object)



File system object - rajeshdizzy - 07-30-2009

Hi bloggers....
i have created a text file and folder in a drive using the fso.but when i use to create copyfolder.i am geting the error like this...
when i move the file using filesystemobject.movefile....
Code:
Dim fso,myfile
Set fso=createobject("scripting.filesystemobject")
Set myfile=fso.createtextfile("D:\Rajeshdizzy.txt",true)
myfile.writeline("Rajesh is the best")
Set MyFile = fso.GetFile("D:\Rajeshdizzy.txt")
MyFile.Copy ("D:\CRP\test2.txt")
Filesystemobject.movefile("D:\rajeshdizzy.txt")

Error as
Object required: 'Filesystemobject


RE: File system object - Saket - 07-30-2009

You should create an object of Filesystemobject first then use it for movefile
fso.Movefile instead of Filesystemobject.movefile


RE: File system object - rajeshdizzy - 07-31-2009

Thankz man...