Monday, 28 August 2017

VBScript (.VBS) Write Text to File

Set objFSO=CreateObject("Scripting.FileSystemObject")
outFile="C:\test\Write Text from VBS.txt"
Set objFile = objFSO.CreateTextFile(outFile,True)
objFile.Write "This is text." & vbCrLf
objFile.Close

Open Notepad
Save as: Write to file.vbs

No comments: