11.07.2015 Views

VBScript Reference Manual for InduSoft Web Studio - ICP DAS

VBScript Reference Manual for InduSoft Web Studio - ICP DAS

VBScript Reference Manual for InduSoft Web Studio - ICP DAS

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>InduSoft</strong> <strong>Web</strong> <strong>Studio</strong><strong>VBScript</strong> <strong>Reference</strong> <strong>Manual</strong>Scripting FileSystemObjectThe <strong>VBScript</strong> FileSystemObject object provides access to a computer's file systemFileSystemObject MethodsMethodDescriptionBuildPathAppends a name to an existing path.CopyFileCopies one or more files from one location to another.CopyFolderRecursively copies a folder from one location to another.CreateFolderCreates a folder.CreateTextFileCreates a specified file name and returns a TextStream object.DeleteFileDeletes a folder and its contents.DeleteFolderDeletes a folder and its contents.DriveExistsIndicates the existence of a drive.FileExistsIndicates the existence of a file.FolderExistsIndicates the existence of a folder.GetAbsolutePathName Returns a complete and unambiguous path from a provided path specification.GetBaseNameReturns the base name of a path.GetDriveReturns a Drive object corresponding to the drive in a pathGetDriveName Returns a string containing the name of the drive <strong>for</strong> a path.GetExtensionName Returns a string containing the extension <strong>for</strong> the last component in a path.GetFileReturns a File object corresponding to the file in a path.GetFileNameReturns the last component of a path that is not part of the drive specification.GetFolderReturns a Folder object corresponding to the folder in a specified path.GetParentFolderName Returns a string containing the name of the parent folder of the last component in apath.GetSpecialFolder Returns the special folder requested.GetTempName Returns a randomly generated temporary file or folder name.MoveFileMoves one or more files from one location to another.MoveFolderMoves one or more folders from one location to another.OpenTextFileOpens a file and returns a TextStream objectFileSystemObject PropertiesProperties DescriptionDrives A Drives collection of all Drive objects available on the local machine.Collections returned by FileSystemObject method calls reflect the state of the file system when thecollection was created. Changes to the file system after creation are not reflected in the collection. If thefile system might be changed during the lifetime of the collection object, the method returning thecollection should be called again to ensure that the contents are current.Set fs = CreateObject("Scripting.FileSystemObject")Set a = fs.CreateTextFile("c:\testfile.txt", True)a.WriteLine("This is a test.")a.CloseIn the code shown above, the CreateObject function returns the FileSystemObject (fs). TheCreateTextFile method then creates the file as a TextStream object (a) and the <strong>VBScript</strong>TextStream Object WriteLine Method writes a line of text to the created text file. The <strong>VBScript</strong>TextStream Object Close Method flushes the buffer and closes the file.<strong>InduSoft</strong>, Ltd. 31

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!