October 20, 2000 - File Operations and Properties
![]() |
October 20, 2000 File Operations and Properties Tips: October 2000
Yehuda Shiran, Ph.D.
|
ActiveXObject() with a single argument, Scripting.FileSystemObject:
myActiveXObject = new ActiveXObject("Scripting.FileSystemObject");
You create a File object by using the ActiveX's GetFile() method:
myFile = myActiveXObject.GetFile("c:\\Autoexec.bat");Here are the File object's properties:
Property Description AttributesRefers to the file attributes DateCreatedReturns the file's creation date DateLastAccessedReturns the file's last-accessed date DateLastModifiedReturns the file's last-modified date DriveReturns the file's letter drive NameReturns the file name ParentFolderReturns the file's parent folder name PathReturns the file's long path ShortNameReturns the file's short name ShortPathReturns the file's short path SizeReturns the file size TypeReturns the file type
Here are the File object's methods:
Method Description Copy()Copies the file from one folder to another Delete()Removes the file Move()Moves the file from one folder to another OpenAsTextStream()Opens the file as a text stream



