' Copyright (C) 2007 TechHit. All rights reserved. ' ' THIS SCRIPT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ' Option Explicit Dim fso, fileMessage, fileMessageList, wshShell, strFile, strMessage If WScript.Arguments.Count < 1 Then WScript.Echo("Usage: exec_all_messages_one_file.vbs message.txt") WScript.Quit End If strFile = Wscript.Arguments(0) Set fso = CreateObject("Scripting.FileSystemObject") ' Open the current message Set fileMessage = fso.OpenTextFile(strFile, 1) ' Read the content of the message into strMessage strMessage = fileMessage.ReadAll() ' Open the output file, creating if it does not exist, and write the line into it. Set fileMessageList = fso.OpenTextFile("c:\all_messages.txt", 8, True) ' Write a line to the file fileMessageList.WriteLine strMessage ' Close the files fileMessage.Close fileMessageList.Close Set fileMessage = Nothing Set fileMessageList = Nothing Set fso = Nothing Set wshShell = Nothing