' Copyright (C) 2009 TechHit. All rights reserved. ' ' THIS SCRIPT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ' Option Explicit Dim fso, fileMessage, fileMessageList, strFile, strMessage, strOutFileName 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() ' Create output file on the Desktop strOutFileName = CreateObject("Shell.Application").Namespace(0).Self.Path & "\all_messages.txt" ' Open the output file, creating if it does not exist Set fileMessageList = fso.OpenTextFile(strOutFileName, 8, True) ' Write current message into the output file fileMessageList.WriteLine strMessage ' Close the files fileMessage.Close fileMessageList.Close Set fileMessage = Nothing Set fileMessageList = Nothing Set fso = Nothing