Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Command Line Parameters

Reply
Thread Tools

Command Line Parameters

 
 
Joiey.Seeley@gmail.com
Guest
Posts: n/a
 
      10-04-2005
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!

 
Reply With Quote
 
 
 
 
Joiey.Seeley@gmail.com
Guest
Posts: n/a
 
      10-04-2005
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.

 
Reply With Quote
 
 
 
 
Evertjan.
Guest
Posts: n/a
 
      10-04-2005
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)

 
Reply With Quote
 
Joiey.Seeley@gmail.com
Guest
Posts: n/a
 
      10-04-2005

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();

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Please help Windows update command line parameters cromi Computer Support 7 04-11-2009 05:57 PM
Parameters (command line, preferences, user input) Kenneth P. Turvey Java 1 02-25-2006 10:10 AM
jdbc query works only with parameters given in command line magda muskala Java 0 02-15-2005 04:00 AM
How to get command line parameters? Tal Raveh Perl 2 06-14-2004 08:45 AM
Servlet parameters different from the command line parameters? Jonck van der Kogel Java 2 05-26-2004 11:34 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57