I have this script that works fine but the only problem is every time I run the script it appends the same data to the end I would like the results to overwrite the reults currently in the second folder.
Const ForAppending = 8, ForReading = 1, ForWriting = 2
set files = objFSO.GetFolder("c:\fso\test").Files
index=1
for each file in files
if index<>5 then
Set objTextFile = objFSO.OpenTextFile _
(strDirectory & "\" & file.name, 1, True)
sRead = objTextFile.ReadAll
objTextFile.Close
Set objTextFile = objFSO.OpenTextFile _
(strDirectory2 & strFile2, 8, True)
' Writes strText every time you run this VBScript
objTextFile.WriteLine(sRead)
objTextFile.Close
index=index+1
end if
next
'objTextFile.Close
WScript.Quit
Thanks
Const ForAppending = 8, ForReading = 1, ForWriting = 2
set files = objFSO.GetFolder("c:\fso\test").Files
index=1
for each file in files
if index<>5 then
Set objTextFile = objFSO.OpenTextFile _
(strDirectory & "\" & file.name, 1, True)
sRead = objTextFile.ReadAll
objTextFile.Close
Set objTextFile = objFSO.OpenTextFile _
(strDirectory2 & strFile2, 8, True)
' Writes strText every time you run this VBScript
objTextFile.WriteLine(sRead)
objTextFile.Close
index=index+1
end if
next
'objTextFile.Close
WScript.Quit
Thanks