Tutorial by Examples

Methods used: .DriveExists(strDrive) returns (True/False) .FileExists(strFile) returns (True/False) .FolderExists(strFolder) returns (True/False) The following code checks for the existence of a file using the "FileExists" method of a file system object. For checking the existence of...
Methods used: .DeleteFolder(FileSpec, Force (True/False)) .CreateFolder(Path) .DeleteFile(FileSpec, Force (True/False)) The following example illustrates the Deletion and creation of a folder using the methods "DeleteFolder" and "CreateFolder". Code: Dim strFolderPath, ob...
Methods Used: .CopyFile(Source, Dest [,Overwrite (True/False)] .CopyFolder(Source, Dest [,Overwrite (True/False)] The following code illustrates the use of CopyFile method to copy a file to a new location. The same thing can be achieved for the folders by using the CopyFolder method. Code: Di...
Methods Used: .MoveFile(Source, Dest) .MoveFolder(Source, Dest) The following code illustrates the use of MoveFile method to Move a file to a new location. The same thing can be achieved for the folders by using the MoveFolder method. Code: Dim objFso, strSourcePath, strDestPath strSourcePat...
Methods used: .GetFolder(strPath) - Returns an object referring to the path We can set an object reference to a folder using the getFolder method and perform different operations on them. Code: Dim strFolderPath, objFso, objFolder strFolderPath = "C:\Users\GS\Desktop\LogsFolder" Se...
Methods Used: .GetFile(strPath) - Returns an object referring to a file. We can set an object reference to a file using the getFile method and perform different operations on them. Code: Dim strFilePath, objFso, objFile strFilePath = "C:\Users\GS\Desktop\LogsFolder\file.txt" Set ob...

Page 1 of 1