Get The Latest Created File
Const cdtFirst = #1/1/100#
Dim sFolder : sFolder = “.\”
Dim oFS : Set oFS = CreateObject( “Scripting.FileSystemObject” )
Dim dtLatest : dtLatest = cdtFirst
Dim sExt : sExt = “ppt” ‘ not entirely sure about this extension
Dim oLFile : Set oLFile = Nothing
Dim oFile
For Each oFile in oFS.GetFolder( sFolder ).Files
If sExt = LCase( oFS.GetExtensionName( oFile.Name ) ) Then
If dtLatest < oFile.DateLastAccessed Then ‘ maybe DateCreated/DateLastModified
dtLatest = oFile.DateLastAccessed
Set oLFile = oFile
End If
End If
Next
If oLFile Is Nothing Then
WScript.Echo “No file with extension”, sExt, “found.”
Else
WScript.Echo “found”, oLFile.Name, oLFile.DateLastAccessed
End If
No comments yet.
-
Archives
- July 2011 (1)
- March 2011 (1)
- November 2010 (1)
- November 2008 (4)
- October 2008 (2)
- September 2008 (2)
- June 2008 (1)
- March 2008 (4)
- February 2008 (44)
-
Categories
- Automated Test Script Creation Process
- Automating MS Word
- Automating QC
- Automation Object Model For QTP
- Backward compatability in QTP
- Browser Scripts
- COM and QTP
- compare 2 text files
- Descriptive programming
- Descriptive Programming and Child Objetcs
- Dictonary Object
- DotNetFactory
- Excel Automation
- Extra Topics
- Files and Folders
- General Standards to be followed in Test scripts
- New Features In QTP9.5
- QC-OTA
- QTP Additional Faqs
- QTP Faqs
- QTP Naming Convention
- QTP Tips and Faqs
- Running stored procedures from QTP
- Send keyboard keys
- Uncategorized
- Uninstall a software using QTP
- Uninstall a software using vbscript
- Update data in a database
- VBScript and IE Automation
- VBScript Faqs and Useful resources
- What’s New in Quick Test Pro 9.0
- Whats New in QTP 9.5
- XML Scripting
-
RSS
Entries RSS
Comments RSS
Leave a comment