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 |
How you can call vbscript functions?
What are class events?
regular expression that will recognize a browser as long as its name property starts with mybrowser
Explain the operator precedence in vb script?
Find Out Length of an array without using Ubound?
When to use function procedures and what are its characteristics?
how to operate webobjects in a webpage using getobject function and then using generic methods?
There is a web Table where You will find Two Columns First Column consist of Check box and Second column consist of Test cases ID(Viz T1,T2,T3....Etc); If You select any Test case ID, respective Check boxes to be checked write a VBSCRIPT for this scenario?
Which function is used in the vbscript language to convert the specified expression into a date type value?
How to assign a numeric value to a variable?
Hi, I need to accept user inputs for login at runtime.I know i can use Inputbox but how to proceed further that i dont know. Thanks in advance
how to declare a variable in vbscript using vbscript