Dim objFileSystem, objOutputFile
Dim strOutputFile
Const OPEN_FILE_FOR_APPENDING = 8
' generate a filename base on the script name
strOutputFile = "./writefile.out"
Set objFileSystem = CreateObject("Scripting.fileSystemObject")
Set objOutputFile = objFileSystem.OpenTextFile(strOutputFile, _
OPEN_FILE_FOR_APPENDING)
objOutputFile.WriteLine("Hello world (" & Now & ")")
objOutputFile.Close
Set objFileSystem = Nothing
WScript.Quit(0)
I found that, but im not 100% on how it would work. For example if the file was still at c:\example.txt where would i put that in the script?