• 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

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.

2 Solutions
David LeeCommented:
Hi, Jose-Valencia.

Use the WScript.Arguments collection.

Bill PrewCommented:
Good write up here too, on named versus positional parms.



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