' Copyright (C) 2009 TechHit. All rights reserved. ' ' THIS SCRIPT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ' Option Explicit Dim fso, fileMessageList, wshShell, strLine, strOutFileName Set wshShell = WScript.CreateObject("WScript.Shell") ' Retrieve values from the environment variables, ' putting quotes around the values and commans between them. strLine = wshShell.ExpandEnvironmentStrings("""%TH_SENDER_NAME%"",""%TH_SENDER_EMAIL_ADDRESS%""") ' Create output file on the Desktop strOutFileName = CreateObject("Shell.Application").Namespace(0).Self.Path & "\my_senders.csv" ' Open the file, creating if it does not exist, and write the line into it. Set fso = CreateObject("Scripting.FileSystemObject") Set fileMessageList = fso.OpenTextFile(strOutFileName, 8, True) ' Write a line to the file fileMessageList.WriteLine strLine ' Close the file fileMessageList.Close Set fileMessageList = Nothing Set fso = Nothing Set wshShell = Nothing