FileSystemObject: get data form files and folders
DateLastModified, DateLastAccessed, DateCreated, Drive, Name, ParentFolder,Path, ShortName, ShortPath, Size, Type, Attributes

File Related data:

DateLastModified, DateLastAccessed, DateCreated, Drive, Name, ParentFolder,Path, ShortName, ShortPath, Size, Type, Attributes
 
 
 

Get file related data Output
<% 
Set fso = CreateObject("Scripting.FileSystemObject") 
Set a = fso.GetFile(Server.MapPath("\") & "\index.asp") 

Response.Write ("DateLastModified: "  & a.DateLastModified & "<BR>")
Response.Write ("DateLastAccessed: "  & a.DateLastAccessed & "<BR>")
Response.Write ("DateCreated: "  & a.DateCreated & "<BR>")
Response.Write ("Drive: "  & a.Drive & "<BR>")
Response.Write ("Name: "  & a.Name & "<BR>")
Response.Write ("ParentFolder: "  & a.ParentFolder & "<BR>")
Response.Write ("Path: "  & a.Path & "<BR>")
Response.Write ("ShortName: "  & a.ShortName & "<BR>")
Response.Write ("ShortPath: "  & a.ShortPath & "<BR>")
Response.Write ("Size: "  & a.Size & "<BR>")
Response.Write ("Type: "  & a.Type & "<BR>")
Response.Write ("Attributes: "  & a.Attributes & "<BR>")

Set fileObject = Nothing 
Set fso = Nothing 
%>

DateLastModified: 3/15/2002 3:03:32 AM
DateLastAccessed: 4/15/2002 7:45:01 AM
DateCreated: 4/1/2002 1:55:11 PM
Drive: e:
Name: index.asp
ParentFolder: E:\clientsites\asptutorial.info
Path: E:\clientsites\asptutorial.info\index.asp
ShortName: index.asp
ShortPath: E:\clientsites\ASPTUT~1.INF\index.asp
Size: 359
Type: ASP auto file
Attributes: 32

Folder Related data:

DateLastModified, DateLastAccessed, DateCreated, Drive, Name, ParentFolder, Path, ShortName, ShortPath, Size, Type, Attributes, IsRootFolder, Subfolders, Files (get list of Folder/files)
 
 

Get folder related data Output
<% 
Set fso = CreateObject("Scripting.FileSystemObject") 
Set a = fso.GetFolder(Server.MapPath("\tryit\")) 

Response.Write ("DateLastModified: "  & a.DateLastModified & "<BR>")
Response.Write ("DateLastAccessed: "  & a.DateLastAccessed & "<BR>")
Response.Write ("DateCreated: "  & a.DateCreated & "<BR>")
Response.Write ("Drive: "  & a.Drive & "<BR>")
Response.Write ("Name: "  & a.Name & "<BR>")
Response.Write ("ParentFolder: "  & a.ParentFolder & "<BR>")
Response.Write ("Path: "  & a.Path & "<BR>")
Response.Write ("ShortName: "  & a.ShortName & "<BR>")
Response.Write ("ShortPath: "  & a.ShortPath & "<BR>")
Response.Write ("Size: "  & a.Size & "<BR>")
Response.Write ("Type: "  & a.Type & "<BR>")
Response.Write ("Attributes: "  & a.Attributes & "<BR>")
Response.Write ("IsRootFolder: "  & a.IsRootFolder & "<BR>")

' to get list of files here
' to get list of folders here

Set a = Nothing 
Set fso = Nothing 
%>

DateLastModified: 4/15/2002 7:23:17 AM
DateLastAccessed: 4/15/2002 7:23:20 AM
DateCreated: 2/4/2002 3:39:18 AM
Drive: e:
Name: prueba
ParentFolder: E:\clientsites\asptutorial.info
Path: E:\clientsites\asptutorial.info\tryit
ShortName: tryit
ShortPath: E:\clientsites\ASPTUT~1.INF\tryit
Size: 43940
Type: File Folder
Attributes: 48
IsRootFolder: False

 


AspTutorial.info.