Mega Code Archive

 
Categories / JavaScript Tutorial / MS JScript
 

File

The File object provides access to all the properties of a file. Property/MethodDescription AttributesRefers to the attributes of the file Copy()Copies a file from one location to another DateCreatedReturns the date a file was created DateLastAccessedReturns the date a file was last accessed DateLastModifiedReturns the date a file was last modified Delete()Removes a file DriveReturns the drive on which a file exists Move()Moves a file from one location to another NameReturns the name for a file OpenAsTextStream()Opens a text stream for a file ParentFolderReturns the parent folder name for a file PathReturns the path to a file ShortNameReturns the shortname of the file ShortPathReturns the shortpath of the file SizeReturns the size of a file TypeReturns the file type <html>     <body>     <script language="JavaScript">     <!--     var myObject, f;     myObject = new ActiveXObject("Scripting.FileSystemObject");     f = myObject.GetFile("c:\\test.txt");     document.write("The name of the file is: " + f.Name);     -->     </script>     </body>     </html>