Link:http://output.to/sideway/default.asp?qno=180500022 Script, Scripting Language, VBScript elements, Server-Side VBScript FileSystemObject Object
VBScript FileSystemObject (FSO) ObjectFileSystemObject (FSO) Object is a VBScript Object designed for providing simple file sytem accessing, and folders and files processing.. Twenty-six Methods are provided for the manipulation of the file system objectes. Ane one property is provided for returning of all available drives in the file system for further manipulation. In general, the file system manipulation of a FileSstemObject Object can be divided into four levels, drive level, folder level, file level, and content level. However, the root directory of a path can be manipulated as a Drive Object at drive level or be manipulated as a Folder Object at folder level because drive is used to specify the properties of the file container while folder is used to specify the properties of the filing system of the file container. While a text file can be manipulated as a File Object at file level or manipulated as a TextStream Object at content level. The returns of Drives Property is a collection of available drive objects, that is the Drives Collection. Additional Count Property, and Item Property are provided for accessing the Properties of Drives Collection directly. Although further properties can be accessed through dot notation, another Object called Drive Object is defined for manipulating these properties of each returned object separately.
FileSystemObject Objectlast updated 12/13/2017is to provide access to a computer's file system. SyntaxSet fsoobjvar = CreateObject("Scripting.FileSystemObject") FileSystemObject Methodslast updated 12/14/2017Twenty-Six Method are provided to manipulate the file system. Syntaxfsoobjvar.BuildPath(path, name) fsoobjvar.CopyFile ( source, destination[, overwrite] ) fsoobjvar.CopyFolder ( source, destination[, overwrite] ) fsoobjvar.CreateFolder(foldername) fsoobjvar.CreateTextFile(filename[, overwrite[, unicode]]) fsoobjvar.DeleteFile ( filespec[, force] ) fsoobjvar.DeleteFolder ( folderspec[, force] )fsoobjvar.DeleteFolder ( folderspec[, force] ) fsoobjvar.DriveExists(drivespec) fsoobjvar.FileExists(filespec) fsoobjvar.FolderExists(folderspec) fsoobjvar.GetAbsolutePathName(pathspec) fsoobjvar.GetBaseName(path) fsoobjvar.GetDrive ( drivespec ) fsoobjvar.GetDriveName(path) fsoobjvar.GetExtensionName(path) fsoobjvar.GetFile(filespec) fsoobjvar.GetFileVersion(pathspec) fsoobjvar.GetFileName(pathspec) fsoobjvar.GetFolder(folderspec) fsoobjvar.GetParentFolderName(path) fsoobjvar.GetSpecialFolder(folderspec) fsoobjvar.GetStandardStream(standardStreamType [, unicode ]) fsoobjvar.GetTempName ( ) fsoobjvar.MoveFile ( source, destination ) fsoobjvar.MoveFolder ( source, destination ) fsoobjvar.OpenTextFile(filename[, iomode[, create[, format]]]) FileSystemObject Propertieslast updated 12/14/2017One Property is provided for manipulate file system Syntaxfsoobjvar.Drives FileSystemObject Collectionslast updated 12/14/2017The output of Drives Property is a collection of Drive Objects, namely Drives Collection SyntaxSet fsodrivecolvar=fsoobjvar.Drives ExamplesExamples of FileSystemObject Object ASP VbScript Command:
HTML Web Page In-line Output:
Results on Microsoft Windows 8.1 Pro x64, Microsoft-IIS/8.5, VBScript Version 5.8 of page /internet/users/sideblog/default.asp varsstrs, TypeNameSet sysfso = CreateObject("Scripting.FileSystemObject"): Set strs=sysfso[FileSystemObject], FileSystemObjectstrs=sysfso.DriveExists("R:/")[True], Booleanstrs=sysfso.BuildPath("R:/","Z")[R:/Z], Stringstrs=sysfso.CreateFolder(strs)[R:\Z], Stringstrs=sysfso.CreateFolder("R:/Y")[R:\Y], StringSet strs=sysfso.CreateFolder("R:/W")[R:\W], Folderstrs=sysfso.CopyFolder("R:/Y","R:/Z/Y",True)[], EmptySet strs=sysfso.CreateTextFile("R:\Z\t1.txt",True)[TextStream], TextStreamstrs=sysfso.CopyFile("R:\Z\t1.txt","R:\Z\t2.txt",True)[], Emptystrs=sysfso.MoveFile("R:\Z\t2.txt","R:/Z/Y/")[], Emptysysfso.MoveFolder "R:\W","R:\Z\" [], Emptystrs=sysfso.FileExists("R:\Z\t2.txt")[False], Booleanstrs=sysfso.FolderExists("R:\Z")[True], Booleanstrs=sysfso.FolderExists("R:\")[True], BooleanSet strs=sysfso.OpenTextFile("R:\Z\t1.txt")[TextStream], TextStreamstrs=sysfso.GetAbsolutePathName("")[C:\Windows\System32\inetsrv], Stringstrs=sysfso.GetBaseName("R:\Z")[Z], StringSet strs=sysfso.GetDrive("R:")[R:], Drivestrs=sysfso.GetDriveName("R:\Z")[R:], Stringstrs=sysfso.GetExtensionName("R:\Z")[], Stringstrs=sysfso.GetFile("R:\Z\t1.txt")[R:\Z\t1.txt], StringSet strs=sysfso.GetFile("R:\Z\t1.txt")[R:\Z\t1.txt], Filestrs=sysfso.GetFileVersion("R:\Z\t1.txt")[], Stringstrs=sysfso.GetFileName("R:\Z\t1.txt")[t1.txt], Stringstrs=sysfso.GetFolder("R:\Z\")[R:\Z], StringSet strs=sysfso.GetFolder("R:\Z\")[R:\Z], Folderstrs=sysfso.GetParentFolderName("R:\Z\t1.txt")[R:\Z], Stringstrs=sysfso.GetSpecialFolder(0)[C:\Windows], StringSet strs=sysfso.GetSpecialFolder(0)[C:\Windows], FolderSet strs=sysfso.GetStandardStream(1)[TextStream], TextStreamstrs=sysfso.GetTempName()[radB539A.tmp], StringSet strs=Nothing: strs=sysfso.DeleteFile("R:\Z\t1.txt")[], Emptystrs=sysfso.DeleteFolder("R:\Z")[], Emptystrs=sysfso.DeleteFolder("R:\Y")[], Empty |
Sideway BICK Blog 22/05 |