Moving a fiel from one location to another - 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: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners) +--- Thread: Moving a fiel from one location to another (/Thread-Moving-a-fiel-from-one-location-to-another) |
Moving a fiel from one location to another - siri - 08-05-2008 Hi, I need to move a file from one location to another the below mentioned is the script : Move a file from one location to another. ----------------------------------------------- Code: 'function: FileMove Here where i need to mention the Source fiel and target file Source file :a Target file :b RE: Moving a fiel from one location to another - kishoreinchennai - 08-05-2008 ' params : strFile - full path to the source file ' strTarget - the folder to move the file to you need to call the function with these files.... Like : FileMove(D:\ccc, D:\Target) Regards Kishore RE: Moving a fiel from one location to another - siri - 08-06-2008 If i place tha also it is showing up an error like "expected identifier" Code: 'function: FileMove RE: Moving a fiel from one location to another - surya_7mar - 08-06-2008 what is the issue yuou are facing here RE: Moving a fiel from one location to another - siri - 08-06-2008 I am facing like EXpected identifier RE: Moving a fiel from one location to another - surya_7mar - 08-06-2008 i am not sure if this is the mistake Actual: Function FileMove("D:\ccc, D:\Target") Should be like Function FileMove("D:\ccc", "D:\Target") RE: Moving a fiel from one location to another - anemuday - 08-07-2008 Hi, Since you are using Function and returning nothing to the function, you are getting that error. If you use sub routine(sub) then you may not get the same error. Here is the script i used to move a file from one location to another location. It worked fine for me. Code: Drivespec="D:\abc\psychology.doc" Regards, Uday. RE: Moving a fiel from one location to another - siri - 08-07-2008 Code: Drivespec="D:\abc\psychology.doc" For the below script i am gettign an error as object not found RE: Moving a fiel from one location to another - anemuday - 08-08-2008 Hi Siri, How the same script is executed in your system. Give a valid file path that exists in your system i.e give a valid file path in places of Drivespec="D:\abc\psychology.doc" (valid file path) DestFolderPath= "E:\abc\ijk"(valid folder path) Regards, Uday. RE: Moving a fiel from one location to another - somisays - 08-09-2008 Dear Siri, Use the following code... Code: Dim fso Make sure in d drive abc folder and psychology.doc exists and In E drive abc and ijk folder exists. |