The Arguments collection property is read only and returns the collection of arguments supplied when invoking the current script. The argument list does not include the name of the host executable file (cscript or wscript), or the name of the script being invoked.
Set objArgs =
WScript.Arguments
WScript.Echo WScript.Arguments.Count
For Each strArg in objArgs
WScript.Echo strArg
Next2
hello
worldThis VBScript code illustrates the use of this property when used in a script that is invoked with the command line "cscript test.vbs hello world".
objArgs = WScript.Arguments
WScript.Echo(WScript.Arguments.Count());
for (i=0;
i<objArgs.length; i++)
{
WScript.Echo(objArgs(i))
}2
hello
worldThis JScript code illustrates the use of this property when used in a script that is invoked with the command line "cscript test.vbs hello world".