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

Posted on 2011-04-21
Last Modified: 2012-05-11
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.

Question by:Jose-Valencia
    LVL 76

    Accepted Solution

    Hi, Jose-Valencia.

    Use the WScript.Arguments collection.
    LVL 51

    Assisted Solution

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


    Featured Post

    Training Course: Java/J2EE and SOA

    This course will cover both core and advanced Java concepts like Database connectivity, Threads, Exception Handling, Collections, JSP, Servlets, XMLHandling, and more. You'll also learn various Java frameworks like Hibernate and Spring.

    Join & Write a Comment

    MS Access 2003 or later To MySQL Migration Project Hello All, this is my second article in the category of MS-OFFICE Automation. In internet I am not able to find any comprehensive resource on the Migration of MS Access back-end to MySQL so I fin…
    Technology opened people to different means of presenting information, but PowerPoint remains to be above competition. Know why PPT still works today.
    The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
    The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now