• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 330
  • Last Modified:

How to Read Command line Parameters from a Script written in a .vbs file. Note: Command() and Command$ do NOT work

Hi,
I have .vbs file where I have code to perform Mail Merging. This uses parameters like Source and Destination file names. Currently I have hard coded the parameter values into the script and  created an .exe file for this .vbs script file using the ScriptCryptor Software available online. This thing works!!

But need to be able to read the parameters for the .exe from the command line where this program will be invoked from.
I could NOT use the  'Command()' or 'Command$' for the parameters, as it does not identify them in the .vbs script.

Note: I do not have Visual Basic Application available, so just wrote this script in NotePad.



I Need help reading the parameters passed to this .exe file from the underlying .vbs program.

0
Jose-Valencia
Asked:
Jose-Valencia
2 Solutions
 
David LeeCommented:
Hi, Jose-Valencia.

Use the WScript.Arguments collection.

http://www.devguru.com/technologies/wsh/quickref/wscript_arguments.html
0
 
Bill PrewCommented:
Good write up here too, on named versus positional parms.

http://technet.microsoft.com/en-us/library/ee156618.aspx

~bp
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now