spacer
Yehuda Shiran October 20, 2000
File Operations and Properties
Tips: October 2000

Yehuda Shiran, Ph.D.
Doc JavaScript

Developer News
Google Going Native With Chrome
Mozilla Fixes Firefox Flaws as 3.5 Release Nears
Microsoft and Novell Still Bosom Buddies

You create an ActiveX File object by calling 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:

PropertyDescription
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:

MethodDescription
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


People who read this tip also read these tips:

Look for similar tips by subject:

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
XML and PHP Simplified · Creating a ASP.NET Contact Form · Data Filtering with PHP
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Intel to Host Live Nehalem Q&A · 12 Tips to Troubleshoot Network File-Sharing · 10 Tips for Selling on Kijiji