Access arguments on the command lineTag(s): WSH VBScript

[args.vbs]

Dim arg

If WScript.Arguments.Count = 0 Then
   WScript.Echo  "no argument on the command line."
Else
   For each arg in WScript.Arguments  
      WScript.Echo "arg : "  & arg 
   Next
End If

WScript.Quit(0)



If you find this article useful, consider making a small donation
to show your support for this Web site and its content.

Written and compiled by Réal Gagnon ©1998-2012
[ home ]