CodePudding user response:
Both Dim files=My.Com puter. FileSystem. GetFiles (" D: \ temp \ ", FileIO SearchOption. SearchAllSubDirectories, "*.txt)
Dim lastFI As the FileInfo=Nothing
For Each s As String files In
Dim FI As the FileInfo=My.Com puter. FileSystem. GetFileInfo (s)
If (lastFI Is Nothing) OrElse (FI) LastWriteTime & gt; LastFI. LastWriteTime) Then
LastFI=FI
End the If
Next
The Debug. Print (" {0} {1} ", lastFI. FullName, lastFI. LastWriteTime)
A=lastFI. FullName
CodePudding user response:
Shell "CMD/dir/o c - d/a, d/b d: \ temp \ *. * & gt; D: \ files. TXT ", vbHide
'd read file: \ files. TXT the content of the first line of the required