Get the App
SLTechnology News&Howtos  ›  Development  › 

The use of GetFile method in VBS

Shulou Source: shulou.com Published: 2022-06-03 19:40:30 11月12日 Update

This article mainly introduces "the use of GetFile method in VBS". In daily operation, I believe many people have doubts about the use of GetFile method in VBS. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful for you to answer the doubts about "the use of GetFile method in VBS". Next, please follow the editor to study!

Returns the File object corresponding to a file in the specified path.

Object.GetFile (filespec)

Parameter object

Required. Should be the name of FileSystemObject.

Filespec

Required. Filespec is the path (absolute or relative path) to the specified file.

Description

If the specified file does not exist, an error occurs.

The following example illustrates how to use the GetFile method:

Function ShowFileAccessInfo (filespec) Dim fso, f, s Set fso = CreateObject ("Scripting.FileSystemObject") Set f = fso.GetFile (filespec) s = f.Path & "

"s = s &" Created: "& f.DateCreated &"

"s = s &" LastAccessed: "& f.DateLastAccessed &"

"s = s &" LastModified: "& f.DateLastModified ShowFileAccessInfo = sEnd Function at this point, the study on" the use of GetFile method in VBS "is over, hoping to solve everyone's doubts. The combination of theory and practice can help you learn better, go and try it! if you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Tags: Methods paths learning files more help practical next examples parameters names objects articles theories knowledge articles websites materials follow errors Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB macOS Shulou Tech Info Huawei OPPO Reno