VBScript method for obtaining file creation time, last modification time and last access time

Copy codeThe code is as follows:

set fso=createobject(“Scripting.FileSystemObject”)
set fn=fso.GetFile(“E:\AD.txt”)
Msgbox “file creation time:” & FN DateCreated
Msgbox “last modified time of file:” & FN DateLastModified
Msgbox “last access time of file:” & FN DateLastAccessed
set fn=nothing
set fso=nothing


Introduction to FileSystemObject object:

The filesystembobject object is used to access the file system on the server. This object can operate on files, folders, and directory paths. You can also get information about the file system through this object.
The following code will create a text file (C: \ test. Txt), and then write some text to this file:

Copy codeThe code is as follows:
dim fs,fname
      set fs=Server.CreateObject(“Scripting.FileSystemObject”)
      set fname=fs.CreateTextFile(“c:\test.txt”,true)
      fname.WriteLine(“Hello World!”)
set fname=nothing
set fs=nothing


For more information, please refer to the official FileSystemObject documentation: http://msdn.microsoft.com/zh-cn/library/aa711216

Recommended Today

Lagrange interpolation — Python

Data analysis Data cleaning: missing value processing, 1 deleting records2 data interpolation3 no treatment Data inhttps://book.tipdm.org/jc/219Data and code in resource package in Chapter4 \ demo \ data \ cataling_ sale. xls Common interpolation methods Interpolation Lagrange interpolation According to mathematical knowledge, for n known points on the plane (no two points), n-1 polynomial can be […]