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

How to send arguments to an external called program

Status
Not open for further replies.

VikramChand

Programmer
Jul 5, 2002
16
US
I am trying to call VB Script using Procomm using

Code:
run "C:\Documents and Settings\test\Desktop\test.vbs"

now i would like to pass arguments to the test.vbs script.

Can anybody help me out in this matter

Thanks

 
Assuming that the parameters should be on the command line with the command (C:\Documents and Settings\test\Desktop\test.vbs Param1 Param2 etc.), then you should be able to include those parameters with the command line in the run command. If those parameters are variable, then you can use something like this code snippet to format the command line string before passing it to the run command:

proc main
string sCmdLine, sFile

sCmdLine = "notepad.exe"
sFile = "c:\autoexec.bat"

strcat sCmdLine " "
strcat sCmdLine sFile
run sCmdLine
endproc

This script shows how to build the command line, starting off with the executable we want to use (notepad), adding the space to the end of the CmdLine string, and finally adding the value of the file we want to launch. You could repeat this final step multiple times, one for each parameter you need to add to the command line.
aspect@aspectscripting.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top