calling a script from within a script / reading a string as a single argument from the command line 
Author Message
 calling a script from within a script / reading a string as a single argument from the command line

Hello all.

I remembered seeing a posting a while ago asking how to read a string from
the command line, and I wanted to share this snippet of code:

set wshShell = wscript.createobject("Wscript.Shell")

wscript.echo "test2 initiating"
iReturn = wshshell.run("wscript f:\test-area\test.vbs " & chr(34)_
       & "hello goodbye so-long" & chr(34) & " done", 1, TRUE)
wscript.echo "test2 completed"

This will call a file called test.vbs.  test.vbs will echo the arguments.

Using the ASCAII value of quotation marks -- chr(34) --, I was able to pass
an entire string as an input argument to test.vbs from this VBScript.
Anyway, I thought I saw someone else trying to figure this out and I wanted
to pass it on!  Thanx to everyone who helped out with my postings!



Sun, 09 Dec 2001 03:00:00 GMT  
 calling a script from within a script / reading a string as a single argument from the command line
FYI: Within the WSH Bazaar there is a FAQ page and a sample page which
contains
also explanations how to call one script from another, how to obtain
arguments, and
what to keep in mind during passing arguments (see also the sneak preview -
chapter 1
- of the WSH Tutorial, which is available for download).

G. Born

Check out WSH Bazaar at:

http://ourworld.compuserve.com/homepages/Guenter_Born/index0.htm

Kris Decker schrieb in Nachricht ...

Quote:
>Hello all.

>I remembered seeing a posting a while ago asking how to read a string from
>the command line, and I wanted to share this snippet of code:

>set wshShell = wscript.createobject("Wscript.Shell")

>wscript.echo "test2 initiating"
>iReturn = wshshell.run("wscript f:\test-area\test.vbs " & chr(34)_
>       & "hello goodbye so-long" & chr(34) & " done", 1, TRUE)
>wscript.echo "test2 completed"

>This will call a file called test.vbs.  test.vbs will echo the arguments.

>Using the ASCAII value of quotation marks -- chr(34) --, I was able to pass
>an entire string as an input argument to test.vbs from this vbscript.
>Anyway, I thought I saw someone else trying to figure this out and I wanted
>to pass it on!  Thanx to everyone who helped out with my postings!



Mon, 10 Dec 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Calling server-script from within client-script

2. calling a script from within a script?

3. CGI Script Call from within VB Script

4. Calling server-script from within client-script

5. How to call a script within a script

6. Calling a script from within a script....

7. Calling a script from within a script....

8. Call another script within a script

9. Single quote in string from data bound control breaks window.open script

10. Problem while testing string array argument of ATLCom object in VB script client

11. Script to read command arguments from a file

12. Calling functions within a script

 

 
Powered by phpBB® Forum Software