PDA

View Full Version : File properties



jcwuerfl
01-02-2002, 12:45 AM
How would you find the properties of files, say what the file creation date or modified date, and if the file is read only, or hidden, or if the archive bit is on or off?

adamdelves
01-02-2002, 10:39 AM
Use the File System Object, Documentation can be found on the following site:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/vtoriVBScript.asp

The files system object can do just about anything with files folders and their properties including renaming, moving, and changing the attributes provided you have the appopriate permissions.

This can only be done on the client side. You cannot create HTML files that contain scripts that access the file system on another computer.

MnInShdw
01-03-2002, 06:51 AM
for getting information on files use this fuction:

Function GenerateFileInformation(File)

Dim S

S = NewLine & "Path:" & TabStop & File.Path
S = S & NewLine & "Name:" & TabStop & File.Name
S = S & NewLine & "Type:" & TabStop & File.Type
S = S & NewLine & "Attribs:" & TabStop & ShowFileAttr(File)
S = S & NewLine & "Created:" & TabStop & File.DateCreated
S = S & NewLine & "Accessed:" & TabStop & File.DateLastAccessed
S = S & NewLine & "Modified:" & TabStop & File.DateLastModified
S = S & NewLine & "Size" & TabStop & File.Size & NewLine

GenerateFileInformation = S

End Function


for file attribute use the following function

Function ShowFileAttr(File)

Dim S
Dim Attr

Attr = File.Attributes

If Attr = 0 Then
ShowFileAttr = "Normal"
Exit Function
End If