' VBScript to execute a command window which runs the XOP.BAT batch file silently.
' This script needs to reside in the same folder as the XOP.BAT file and be started 
' in the same folder ("Start in:") as XOP.BAT when using a shortcut to avoid providing
' the full path to XOP.BAT.
' The script takes one command-line parameter as input (the program to be executed),
' which is passed to XOP.BAT.
' The ampersand (&) is used for string concatenations.

' Roger J. Dejus
' Argonne National Laboratory
' September 28, 2007

If WScript.Arguments.Count = 1 Then
  arg = " " & WScript.Arguments.Item(0)
Else
  arg = ""
End If

' Define command to be executed.
Command = "cmd.exe /c xop.bat" & arg

' Save for debugging
'wscript.echo wscript.version
'wscript.echo arg 
'wscript.echo command

' Create object and run the command window invisible
CreateObject("Wscript.Shell").Run(Command),0, False
