Show Buttons
Share On Facebook
Share On Twitter
Share On Google Plus
Share On Linkdin
Share On Reddit
Contact us
Hide Buttons

FileSystemObject : GetFile Method


Returns a file object cor­re­spond­ing to the file in a spec­i­fied path.

Format : 


objectOf­FileSys­te­mOb­ject: As the name says, it’s a FileSystemObject.

    • file­spec
      • Manda­tory
      • Type:     String
      • Spe­cific file path

Function FnGetFile(strSpecificFilePath)

    Set fso = CreateObject("Scripting.FileSystemObject")

    Set file = fso.GetFile(strSpecificFilePath)

   s = file.Path & "<br>"

   s = s & "Created: " & file.DateCreated & "<br>"

   s = s & "Last Accessed: " & file.DateLastAccessed & "<br>"

   s = s & "Last Modified: " & file.DateLastModified   

End Function

 Call FnGet­File (“c:\New Folder\file.txt”)


You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: