Passing parameters from script to command line 
Author Message
 Passing parameters from script to command line

Hi:

I am trying to pass 2 parameters from my script to a command line program.
I am unable to get it to work.  How can I modify the line << shell.run
"pkzip25 -extract -dir" x1 x2 >> so that it works?  I have tried placing x1
and x2 within the quotes but it doesn't work either.  Thank you for your
help.

Erik

Question = InputBox("Do you want the installer file
unzipped?","QUESTION","Yes\No")
 If Question = "Yes" Then
   UnzipLocation = InputBox("Where do you want the file unzipped
to?","UNZIPLOCATION","C:\temp")
   UnzipLocation = (UnzipLocation & "\")
      set shell = createobject("wscript.shell")
      Dim x1
      Dim x2
      x1 = (FileLocation & "ap_win32.zip")
      x2 = (UnzipLocation)
      shell.run "pkzip25 -extract -dir" x1 x2
Else
       End if



Wed, 10 Sep 2003 09:24:25 GMT  
 Passing parameters from script to command line

Quote:

> Hi:

> I am trying to pass 2 parameters from my script to a command line program.
> I am unable to get it to work.  How can I modify the line << shell.run
> "pkzip25 -extract -dir" x1 x2 >> so that it works?  I have tried placing x1
> and x2 within the quotes but it doesn't work either.  Thank you for your
> help.

> Erik

> Question = InputBox("Do you want the installer file
> unzipped?","QUESTION","Yes\No")
>  If Question = "Yes" Then
>    UnzipLocation = InputBox("Where do you want the file unzipped
> to?","UNZIPLOCATION","C:\temp")
>    UnzipLocation = (UnzipLocation & "\")
>       set shell = createobject("wscript.shell")
>       Dim x1
>       Dim x2
>       x1 = (FileLocation & "ap_win32.zip")
>       x2 = (UnzipLocation)
>       shell.run "pkzip25 -extract -dir" x1 x2
> Else
>        End if

Concatenate the variables with spaces between them.  Think of
constructing the whole command line as if it were a string (which it
must be to pass to the command processor).  For example, ...

      shell.run "pkzip25 -extract -dir " & x1 & " " & x2

Tom Lavedas
-----------
http://www.pressroom.com/~tglbatch/



Fri, 12 Sep 2003 10:54:49 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. How do I pass a command-line parameter to my vbs file

2. command line parameters passed to VBS???

3. Passing command line parameters to external program

4. Passing values into and out of Command Line application *and* command line prompt in vbscript

5. Scripting command line applications & Command Line Prompting

6. command-line parameters in a script

7. Passing Parameter [AutoRun] by Command Line

8. passing command line parameters in ide

9. Passing Command Line Parameters to an Existing Instance of your App

10. Passing a command line parameter to a QBASIC 4.5 program

11. Passing Command line parameters to a shelled program

12. Passing a parameter to VB on the command line

 

 
Powered by phpBB® Forum Software