' VBScript
Dim FSO, F, ExecuteInfo, ReadString, Counter
Const setRead = 1, setWrite = 2, useDefault = -2
Set FSO = WScript.CreateObject("Scripting.FileSystemObject")
FSO.CreateTextFile "test.txt"
Set F = FSO.GetFile("test.txt")
Set ExecuteInfo=F.OpenAsTextStream(setWrite, useDefault)
Counter = 0
While Counter <= 5
Counter = Counter +1
ExecuteInfo.WriteLine "Строка " & Counter
Wend
ExecuteInfo.Close
Set ExecuteInfo = F.OpenAsTextStream(setRead, useDefault)
ReadString = ExecuteInfo.ReadLine
ExecuteInfo.Close
Код на VBScript (WSH).
Сохраняется с расширением .vbs