File PropertiesName and Size are just two file properties that can be obtained by using FileSystemObject. A file property describes aspects of the file such as when it was created, when it was last accessed, when it was modified, its path, its size, and its type. The intrepid network administrator can enumerate various file properties, which can be used for both security purposes and user data management. For example, as shown in the following code, you can add a couple of lines to the ListFiles.vbs script to retrieve additional datain this case, the date the file was created and the date it was last modified. The VbTab constant is added to make the output easier to read. The completed script is saved as \My Documents\Microsoft Press\VBScriptSBS\ch06\ListFilesExtProperties.vbs. Here are the additional lines: WScript.Echo VbTab & "created: " & objFile.DateCreated WScript.Echo VbTab & "modified: " & objFile.DateLastModified Additional file object properties can be retrieved in the same manner. All are listed in Table 6-2.
![]() |