Ad Home

Theme images by kelvinjay. Powered by Blogger.

Travel

Header Ads

Java

Selenium

UFT

Framework

General QA Concept

BDD

» » How to Get Created Date And Time Of a Particular File in QTP or In VBScrit?

How to get created date and time of a particular file?
I googled a bit and find out the proper solution for the same.
Here goes the code...


Set f1 = CreateObject("Scripting.FileSystemObject")
Set f2 = f1.GetFile("E:\fak.txt")
S = "File was Created on: "&f2.DateCreated
Msgbox SOutput->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 SOutput->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:\fak.txt")S = "File was Last Accessed on: "&f2.Datelastaccessed
Msgbox SOutput->File was Last Accessed on: 10/12/2008 3:55:15 PM


Hope this will help you.














«
Next
Newer Post
»
Previous
Older Post

No comments:

Leave a Reply