Command Line Parameters

Discussion in 'Javascript' started by Joiey.Seeley@gmail.com, Oct 4, 2005.

  1. Guest

    I would like to run a command line program from within my Javascript.
    This is a standalone script not running in a browser. This is also
    running on Windows. I have tried using the WshShell.AppActivate method
    and the WshShell.Exec method. I am able to run a command line program
    with either of those, but am not able to pass in parameters so it is
    essentially useless. Can someone tell me how I can do this? An
    example as simple as how to run something like "ping -t google.com"
    would be great.

    Thanks in advance!
    , Oct 4, 2005
    #1
    1. Advertising

  2. Guest

    Your answer does not seem to apply here. I am not talking about a web
    application. This is a windows shell script built in JavaScript. It
    is a script designed to handle large volumes of file parsing and
    distribution. This script has no interactivity with a browser or with
    users. It silently runs as a batch utility.
    , Oct 4, 2005
    #2
    1. Advertising

  3. Evertjan. Guest

    wrote on 04 okt 2005 in comp.lang.javascript:

    > Your answer does not seem to apply here.


    Please always quote on usenet.
    This is not email.

    > I am not talking about a web
    > application. This is a windows shell script built in JavaScript. It
    > is a script designed to handle large volumes of file parsing and
    > distribution. This script has no interactivity with a browser or with
    > users. It silently runs as a batch utility.


    Try:

    function runMe(myPath)
    {
    var myShell = new ActiveXObject("WScript.Shell");
    myShell.Run(myPath, 1, true);
    }



    --
    Evertjan.
    The Netherlands.
    (Replace all crosses with dots in my emailaddress)
    Evertjan., Oct 4, 2005
    #3
  4. Guest

    Evertjan. wrote:
    > wrote on 04 okt 2005 in comp.lang.javascript:
    >
    > > Your answer does not seem to apply here.

    >
    > Please always quote on usenet.
    > This is not email.
    >
    > > I am not talking about a web
    > > application. This is a windows shell script built in JavaScript. It
    > > is a script designed to handle large volumes of file parsing and
    > > distribution. This script has no interactivity with a browser or with
    > > users. It silently runs as a batch utility.

    >
    > Try:
    >
    > function runMe(myPath)
    > {
    > var myShell = new ActiveXObject("WScript.Shell");
    > myShell.Run(myPath, 1, true);
    > }
    >
    >
    >
    > --
    > Evertjan.
    > The Netherlands.
    > (Replace all crosses with dots in my emailaddress)


    Thanks. This was more along the lines of what I needed. I ended up
    using

    WshShell.Run();

    followed by

    WshShell.SendKeys();
    , Oct 4, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tal Raveh
    Replies:
    2
    Views:
    632
    Ralf Wahner
    Jun 14, 2004
  2. Jonck van der Kogel
    Replies:
    2
    Views:
    959
    Jonck van der Kogel
    May 27, 2004
  3. magda muskala
    Replies:
    0
    Views:
    602
    magda muskala
    Feb 15, 2005
  4. Kenneth P. Turvey
    Replies:
    1
    Views:
    372
    Paul Hamaker
    Feb 25, 2006
  5. qazmlp
    Replies:
    7
    Views:
    533
    Adrian
    Oct 31, 2004
Loading...

Share This Page