Wscript.echo "Prompting for the folder where chats in txt format are located..." Dim returntext returntext = InputBox("Enter the full path to the folder tha contains your chats in text format: (for example C:\Chats\Export)") emailFrom = InputBox("Enter your chat email address, this will set the 'to' feild of the chat email: (ex. bshoemate98@yahoo.com)") outputfile = InputBox("Where do you want to store the output file - enter full path and name with .txt extension (example c:\output.txt)") Wscript.echo "** PROCESSING - PLEASE WAIT: This takes about 10 seconds for every 1000 chat files. I will prompt you again when I'm done :) **" Const ForReading = 1 Set objFSO = CreateObject("Scripting.FileSystemObject") Set objOutputFile = objFSO.CreateTextFile(outputfile) strComputer = "." Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") Set FileList = objWMIService.ExecQuery _ ("ASSOCIATORS OF {Win32_Directory.Name='" + returntext +"'} Where " _ & "ResultClass = CIM_DataFile") For Each objFile In FileList Set objTextFile = objFSO.OpenTextFile(objFile.Name, ForReading) Set fil =objFSO.getFile(objFile.Name) if fil.size > 0 then strText = objTextFile.ReadAll objTextFile.Close strSubject = left(strText, 100) strSubject = Replace(strSubject, vbCrLf, " ") strFileName = split(objFile.Name, "-", 3) strFrom = strFileName(2) firstP = instr(strText, "(") secP = instr(strText, ")") if firstP > 0 then strTime = Mid(strText,firstP+1,secP-firstP-1) end if objOutputFile.WriteLine "From " + strFrom + "@yahoo.com " + strTime objOutputFile.WriteLine "Date: " + strTime + " (GMT+3)" objOutputFile.WriteLine "From: " + strFrom +"@yahoo.com" objOutputFile.WriteLine "To:" + emailFrom objOutputFile.WriteLine "Subject: " + strSubject objOutputFile.WriteLine "MIME-Version: 1.0" objOutputFile.WriteLine "Content-Type: TEXT/PLAIN; charset=US-ASCII" objOutputFile.WriteLine "Status: O" objOutputFile.WriteLine "X-Status: " objOutputFile.WriteLine strText end if Next objOutputFile.Close Wscript.echo "Done. No errors. Open " + outputfile + " to verify. Go to http://www.BenShoemate.com for further instructions."