Option Explicit On Error Resume Next Dim i Dim objDict Dim myArray Dim dictResults Set objDict = CreateObject("Scripting.Dictionary") Set dictResults = CreateObject("Scripting.Dictionary") ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Get Arguments For i = 0 to Wscript.Arguments.Count - 1 myArray = split(Wscript.Arguments(i),"=",-1,1) objDict.Add myArray(0),myArray(1) Next ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' If objDict.Exists("sender-email") Then If objDict.Item("sender-email") <> "" Then 'Sample input data 'WinNT://DOMAIN/username dictResults.Add "UserName", Mid(objDict.Item("sender-email"),InstrRev(objDict.Item("sender-email"),"/")+1) Else 'oOutputFile.WriteLine "sender-email is empty" End If Else 'oOutputFile.WriteLine("sender-email item does NOT exist") End If If dictResults.Count > 0 Then Call DisplayResults() End If WScript.Quit(0) ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Sub DisplayResults() Dim myArray Dim i Dim strValue myArray = dictResults.Keys ' Get the keys. For i = 0 To dictResults.Count - 1 ' Iterate the array. strValue = dictResults.item(myArray(i)) 'strValue = "" & strValue & "" wscript.echo myArray(i) & "=" & strValue Next End Sub