Code Script .co.uk

Home | Scripts | Tutorials | Disclaimer | Sitemap | Contact

   File Object
 

Vbs / File Object


Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.GetFile("file.txt")


Properties

Attributes - allows you to get or change the various attributes of a file.

objFile.Attributes [ =newattributes]


DateCreated - gets the date and time that the file was created.

objFile.DateCreated


DateLastAccessed - gets the date and time that the file was last accessed

objFile.DateLastAccessed


DateLastModified - returns the date and time that the file was last modified.


objFile.DateLastModified


Drive - returns the drive letter of the drive where the file is located.

objFile.Drive


Name - get or change the name of the specified file.

objFile.Name


ParentFolder -  the Folder object for the parent folder

objFile.ParentFolder


Path - This property returns a file's path.

objFile.Path


ShortName - the short version of a filename

objFile.ShortName


ShortPath- the short version of the file path

objFile.ShortPath


Size - the size of a file in bytes.

objFile.Size


Type the file type description

objFile.Type


Methods

Copy - copy the selected file to the specified destination.

objFile.Copy destination[, overwrite]


Delete delete the file

objFile.Delete [force]


Move - move the file to a new destination.

objFile.Move destination

OpenAsTextStream - returns an instance of a TextStream object that can be read from, written or appended to.

objFile.OpenAsTextStream([iomode [,format]])





Please note that a disclaimer applies to any code on this page.
 
   Actions
  Go Back
  Bookmark
  Print Page


   Menu
 
- Links
- Reference
- Script Editors
- Tutorials
- Vbscript