Passing values to a .VBS file... 
Author Message
 Passing values to a .VBS file...

Pass arguments via the normal command line as space separated values.  If an argument includes a space, included it in quotes (note that you can't embedded or include quotes in an argument as in the "z ""a"" p" below.  If you use switches, use /sw or -sw style.  Any // sequence is reserved for host switches like the debugging x and d switches.

myscript.vbs abc "x y z" foo "bar" "z ""a"" p"

=== myscript.vbs ===

'count 1-based
msgbox wscript.arguments.count & " arguments passed"

'indexing is 0-based
if wscript.arguments.count > 0 then
  'note what happened to "z ""a"" p"
  msgbox "first argument is: " & wscript.arguments(0)
end if

for each arg in wscript.arguments
    msgbox arg
next

--
Michael Harris

  How can I pass parameters to a VBScript file through a shortcut in Windows?

  Thanks,

  </Connick>



Tue, 04 Jun 2002 03:00:00 GMT  
 Passing values to a .VBS file...

Thanks heaps for that Michael!

</Connick>

  Pass arguments via the normal command line as space separated values.  If an argument <snip>



Wed, 05 Jun 2002 03:00:00 GMT  
 Passing values to a .VBS file...
How can I pass parameters to a VBScript file through a shortcut in Windows?

Thanks,

</Connick>



Wed, 05 Jun 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Pass a value to a vbs file

2. passing values from .vbs file to command line under WSH

3. Passing values to variables in a .vbs file

4. Problem of Passing value from .asp to .vbs

5. Passing values between an ASP page and an HTA - VBS script

6. How do you pass parameters from a batch file to a VBS file

7. Passing Values to another asp file from inside VbScript

8. Passing values back to batch file

9. How can i pass parameters to a VBScript (files *.vbs)

10. passing a parameter to a VBS file

11. Passing parameters to .Vbs files

12. How can i pass parameters to a VBScript (files *.vbs)

 

 
Powered by phpBB® Forum Software