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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using command prompt to run a script

Status
Not open for further replies.

flybravo

Programmer
Jun 30, 2003
35
US
I'm trying to execute this script from command prompt using WScriptThis is what I do to run the script.
C:\>WScript /"Test"
the message box will load but the there is no text.
What i'm I doing wrong

<CODE>

Call Message(st)

Public Function Message(name)
WScript.Echo name
End Function

</CODE>
 
You have to retrieve the command line arguments, like this:
Code:
Set objArgs = WScript.Arguments
For I = 0 to objArgs.Count - 1
   st = &quot;Arg &quot; & I & &quot; = &quot; & objArgs(I)
   Call Message(st)
Next

Hope This Help
PH.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top