This month, I continue my discussion of the File System Object (FSO) model by looking at the TextStream object. I show you how to access this object so that you can read and write to text files. However, before I discuss the TextStream object, I want to discuss why you might encounter a security warning if you run VBScript code that uses objects in the FSO model.
Security Implications When Using VBScript and FSO
Microsoft initially designed VBScript as a tool to make Web pages more interactive and responsive. As such, VBScript was subject to several security restrictions, including an inability to access the local file system. However, VBScript quickly evolved from a mere tool for writing Web pages to a general-purpose instrument for automating COM-based software.
Microsoft then introduced a modernized version of command.com for Windows OSs called Windows Script Host (WSH). Because VBScript is one of the languages that WSH supports, VBScript needed to gain access to local file-system elements so that VBScript code executing within the Windows shell could read and write to local files as well as access memory, databases, and other resources. . . .
Ken Swenson October 26, 2003