How to find a latest file from any folder
Answers were Sorted based on User's Feedback
Answer / david
in solaris / unix you can find the latest file by...
ls -lt
| Is This Answer Correct ? | 4 Yes | 0 No |
Answer / manjunathareddy
sPath="C:\FlightFrameWork"
Msgbox GetNewestFile(sPath)
Function GetNewestFile(ByVal sPath)
sNewestFile = Null
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oFolder = oFSO.GetFolder(sPath)
Set oFiles = oFolder.Files
For Each oFile In oFiles
On Error Resume Next
If IsNull(sNewestFile) Then
sNewestFile = oFile.Path
dPrevDate = oFile.DateLastModified
Elseif dPrevDate < oFile.DateLastModified Then
sNewestFile = oFile.Path
End If
On Error Goto 0
Next
If IsNull(sNewestFile) Then sNewestFile = ""
GetNewestFile = sNewestFile
End Function
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / sha
How to find a latest file from any folder by using vb script?
| Is This Answer Correct ? | 1 Yes | 0 No |
Is vbscript language a case-sensitive language and what does it mean?
Write VB script to convert from feet to inches(hint 1feet=12 inches)
What is the scope of a constant declared using public?
Hai this is sheik, i want to learn VB scripts for web application pls guide me what are all basic things need to know to learn VB scripts in web application.
Hi anyone Can Send Solution to the Question wt m posting now Prepare Script for the Bellow Scenario? Login to Gmail Page Open Inbox check Mails save them in a Folder
What is Querystring collection?
Explain the asc function?
What is difference between Active screen and movie screen recorder in QTP 9.2?
What is the difference between for loop and while loop?
can anybody tell vb script code for alphanumeric and special character .which is used in qtp the name text field.
How to assign a date value to a variable?
Hi Friends, I have an issue like the describe below: I'm using QTP and I'm testing on SharePoint. As you knoe, SharePoint has a customize function for user, so that, If I add an object Web Table at the first time, that object was recognized by "index" and "html tag", after that, if someone change the display of web part, the "Index" of my object was changed as well and QTP unable to select that Web Table. Can you guide me how to identify or anyway to keep that Web Table object as unique object? Thanks a lot.