Example 1 – Basic VBScript to Create a File with CreateTextFile.The basics are covered in creating folders (), this page deals with creating files, whilst deals with reading and writing text into the file that we which we created with the first two scripts. Topics for Creating a File with VBScriptĬreating the file, covered on this page, is the middle of a series of three FSO examples. Remember, that scripting starts at the folder level, therefore, even if you are primarily interested in saving to a file, your script must first get or create the parent folder. Software inventory, registry values and event logs are just some of the examples that spring to mind. I expect that you can think of many scripting scenarios where it would be advantageous to output the data, not to the screen, but to a file.
This page concentrates on creating a text file with a VBScript.