ArtsAutosBooksBusinessEducationEntertainmentFamilyFashionFoodGamesGenderHealthHolidaysHomeHubPagesPersonal FinancePetsPoliticsReligionSportsTechnologyTravel
  • »
  • Technology»
  • Computers & Software

VB Scripting File system Object

Updated on April 19, 2012

File System Object

To work with file system object you should have the knowledge of vb scripting. just basic knowledge is enough to handle the tasks over here

File system object is a scripting runtime object. By creating object for file system object we use methods and properties of file system object to perform tasks

File system object is very intresting concept that we can automate entire processes that done manually i.e

creating folders,copying folders,Deleting folders,moving folders,creating text files,writing text file,copying text from one text file to other text file creating any format files creating time stamp

To Create Folder

set fso=createobject("scripting.filesystemobject")
fso.createfolder "D:\madhu"


To Move Folder one path to other Path

fso.movefolder "D:\madhu","D:\Sree Harsha\"

To copy Folder to other path

fso.copyfolder "D:\madhu","D:\Sree Harsha\"

To create text file

set fso=createobject("scripting.filesystemobject")
fso.createtextfile ("D:/madhu.txt")


to get the file

set fso=createobject("scripting.filesystemobject")
fso.createtextfile "D:/madhu.txt"
set fld=fso.getfile ("D:/madhu.txt")


To move File one path to other Path

fso.movefile "D:\madhu","D:\Sree Harsha\"


To copy File to other path

FSO.copyfile "D:\madhu","D:\Sree Harsha\"


To get List of subfolder and count of Subfolder

Set fso = CreateObject("Scripting.FileSystemObject")

Set b = fso.GetFolder("d:\madhu")
Set c = b.SubFolders
msgbox typename "c"
foldercount=c.Count
msgbox foldercount
For Each d in c
e=e&d.name&vbnewline
Next
msgbox e

Comments

    0 of 8192 characters used
    Post Comment

    • madhuwillb profile image
      Author

      madhuwillb 5 years ago from Bangalore

      thank you very much for your valuable comment

    • profile image

      vamsi 5 years ago

      good hub

    • madhuwillb profile image
      Author

      madhuwillb 5 years ago from Bangalore

      please submit your valuable comments