To use an object you must create an instance that is declared and a name. To do this you use the CreateObject command. The syntax for creating an object is:
Code:
September ObjectName = CreateObject ("object type")
The FileSystemObject allows you to work with files and folders on your hard disk. This object is used to create other objects that will be the folder, file or drive. In the following example we take a look :
Code:
<script language="vbscript">
Function showfile (folderspec)
Dim fso, folder, file, FileItem
Set fso = CreateObject ("Scripting.FileSystemObject")
Set folder = fso.GetFolder (folderspec)
September folder.Files file =
For Each file in FileItem
document.write FileItem & <br/> "
Next
End Function
Showfile ("c")
</ Script>
The start of this function in an HTML page tells us that you are creating a situational hazard. In fact, the following function displays the files but as we shall see, there are also commands to delete files and folders.
Bookmarks