Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Command Line Arguments 1

Status
Not open for further replies.

NFI

Programmer
Jun 7, 2000
278
GB
What ho,<br><br>&nbsp;&nbsp;do any of you clever chaps out there know how to pass command line arguments into a VBScript?&nbsp;&nbsp;It doesn't seem to recognise the Command() object as used in full blown VB and I've had no success in trying other methods...any help would be very much appreciated,<br><br>&nbsp;&nbsp;cheerio,<br><br>&nbsp;&nbsp;&nbsp;Paul
 
Are you writing a desktop script or a web page?&nbsp;&nbsp;Can you give more details as to what you're trying to do? <p>nick bulka<br><a href=mailto: > </a><br><a href= > </a><br>
 
Ah, <br><br>I'm writing a &quot;desktop&quot; script - it's a script to launch and control an object I've written, to run from the command line (hence the query over command line arguments) under Windows NT4.0<br><br>The script will eventually be implemented from a scheduler application, although this shouldn't affect its behaviour or requirements.<br><br>Thanks for taking a look at this,<br><br>Paul
 
Paul,<br>&nbsp;&nbsp;&nbsp;You need to use the arguments collection.&nbsp;&nbsp;Here's an example:<br><br>Set objArgs = WScript.Arguments<br>WScript.Echo WScript.Arguments.Count<br>For Each strArg in objArgs<br>&nbsp;&nbsp;&nbsp;&nbsp;WScript.Echo strArg<br>Next <br><br> <p>nick bulka<br><a href=mailto: > </a><br><a href= > </a><br>
 
Thanks very very very very much indeed, that works brilliantly,<br><br>&nbsp;cheerio,<br><br>&nbsp;&nbsp;&nbsp;Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top