Showing posts with label filesystemobject. Show all posts
Showing posts with label filesystemobject. Show all posts

How to Move a File From One Location to Another in QTP?

Script to copy a file and folder from one location to other in QTP


Script for moving a file from One location to Another location in QTP?


Dim f
Set f = CreateObject("Scripting.FileSystemObject")
f.MoveFile "D:\laxmi.txt", "C:\"
Msgbox "File Moved"


Above script is for moving a text file(laxmi)from D drive to C drive.


The MoveFile method takes two parameters,the source file and the destination.


Syntax:object.MoveFile (source,destination)


My Article in Ezine Articles

Data Driven Using Notepad

Script to copy a file and folder from one location to other in QTP

SQL Queries Collection

Movie Songs Lyrics

Manual Testing Faqs

QTP Script to Get Created Date and Time,Modified Date and Time & Accessed Date and Time of a File.

How to get created date and time of a particular file?

Set f1 = CreateObject("Scripting.FileSystemObject")
Set f2 = f1.GetFile("E:\Lak.txt")
S = "File was Created on: "&f2.DateCreated
Msgbox S

Output->File was Created on: 10/12/2008 3:45:16 PM

How to get last Modified date and time of a particular file?

Set f1 = CreateObject("Scripting.FileSystemObject")
Set f2 = f1.GetFile("E:\Lak.txt")
S = "File was Last Modified on: "&f2.Datelastmodified
Msgbox S

Output->File was Last Modified on: 10/12/2008 3:51:24 PM

How to get last accessed date and time of a particular file?

Set f1 = CreateObject("Scripting.FileSystemObject")
Set f2 = f1.GetFile("E:\Lak.txt")
S = "File was Last Accessed on: "&f2.Datelastaccessed
Msgbox S

Output->File was Last Accessed on: 10/12/2008 3:55:15 PM


Movie Songs Lyrics

SQL Queries

QTP Script to Get Names of Subfolders in a Folder

Script in QTP to get Collection(names) of Subfolders in a Folder.

Below script is to get Subfolders names in Folder V1
Where Folder V1 is in Fdrive.
Dim a,b, c, d, e
Set a = CreateObject("Scripting.FileSystemObject")
Set b = a.GetFolder("F:\V1")
Set c = b.SubFolders
For Each d in c
e=e&d.name&vbnewline
Next
msgbox e

Movie Songs Lyrics
SQL Queries

Related Posts Plugin for WordPress, Blogger...

Fun and Knowledge