When writing scripts for Active Server Pages, the Windows Script Host, or other applications where scripting can be used, it’s often important to add, move, change, create, or delete folders (directories) and files on the Web server. It may also be necessary to get information about and manipulate drives attached to the Web server.
Scripting allows to process drives, folders, and files using the FileSystemObject (FSO) object model.
FileSystemObject (FSO) Object Model
The FileSystemObject (FSO) object model allows using the familiar object.method syntax with a rich set of properties, methods, and events to process folders and files.
This object-based tool can be with:
- HTML to create Web pages
- Windows Scripting Host to create batch files for Microsoft Windows
- Script Control to provide a scripting capability to applications developed in other languages
- The FSO object model gives server-side applications the ability to create, alter, move, and delete folders, or to detect, and also to get the information about folders, such as their names, the date they were created or last modified, and so forth.
o The FSO object model makes easy to process the files (such as create files, insert and change the data, and output (read) the data).
- Also supports text file creation and manipulation through the TextStream object.
Because use of the FSO on the client side raises serious security issues about providing potentially unwelcome access to a client’s local file system, this documentation assumes use of the FSO object model to create scripts executed by Internet Web pages on the server side. Since the server side is used, the Internet Explorer default security settings do not allow client-side use of the FileSystemObject object. Overriding those defaults could subject a local computer to unwelcome access to the file system, which could result in total destruction of the file system’s integrity, causing loss of data, or worse.