FileSystemObject Operations
Advanced VBScript on ASPPY · Created 2026-06-01 13:34:28
ASPPY supports FSO for server-side file operations.
Read a File
Set fso = CreateObject('Scripting.FileSystemObject')
Set file = fso.OpenTextFile(Server.MapPath('/data/sample.txt'))
text = file.ReadAll() : file.Close
Write a File
Set fso = CreateObject('Scripting.FileSystemObject')
Set file = fso.CreateTextFile(Server.MapPath('/data/out.txt'), True)
file.WriteLine('Hello') : file.Close
Useful Methods
fso.FileExists(path)
fso.FolderExists(path)
fso.CreateFolder(path)
fso.DeleteFile(path)
fso.GetFileName(path)
fso.GetExtensionName(path)
fso.GetTempName()
Note
Server.MapPath converts /data/file.txt to physical path. Ensure www/data is writable.
Live Demo →
Read a File
Set fso = CreateObject('Scripting.FileSystemObject')
Set file = fso.OpenTextFile(Server.MapPath('/data/sample.txt'))
text = file.ReadAll() : file.Close
Write a File
Set fso = CreateObject('Scripting.FileSystemObject')
Set file = fso.CreateTextFile(Server.MapPath('/data/out.txt'), True)
file.WriteLine('Hello') : file.Close
Useful Methods
fso.FileExists(path)
fso.FolderExists(path)
fso.CreateFolder(path)
fso.DeleteFile(path)
fso.GetFileName(path)
fso.GetExtensionName(path)
fso.GetTempName()
Note
Server.MapPath converts /data/file.txt to physical path. Ensure www/data is writable.
Live Demo →