I need some help with this script.
This script is working right, it reads all the .txt files in a folder and add content in the first line.
I just need to modify it so I can add the content after the 1st line of the text files.
Thank you very much
file.txt example:
line 1
my text goes here
line 2
line ...
vbs script:
Dim FSO, txs, fld, fil, content
Set FSO = CreateObject("Scripting.FileSystemObject")
Set fld = FSO.GetFolder("C:\test\")
For Each fil In fld.Files
If Right(fil.Name, 3) = "pat" Then
Set txs = fil.OpenAsTextStream(1) ' 1 = for reading
content = txs.ReadAll
txs.Close
Set txs = fil.OpenAsTextStream(2) ' 2 = for writing
txs.Write "MyDisclaimer:" & vbCrLf & content
txs.Close
End If
Next



Help
Back to top









