HighDots Forums  

Command Line Parameters

Javascript JavaScript language (comp.lang.javascript)


Discuss Command Line Parameters in the Javascript forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Joiey.Seeley@gmail.com
 
Posts: n/a

Default Command Line Parameters - 10-04-2005 , 03:26 PM






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
  #2  
Old   
Dr Clue
 
Posts: n/a

Default Re: Command Line Parameters - 10-04-2005 , 04:29 PM






Joiey.Seeley (AT) gmail (DOT) com wrote:
Quote:
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.

Well, you would probably be best served with a servlet or cgi
that was set up with permissions to run the program and giftwrapped
it in an http response

This would allow you to use XMLHTTP or a hidden frame
to revceive the ping results to relay to the webpage
without a page reload.


--
--.
--=<> Dr. Clue (A.K.A. Ian A. Storms) <>=-- C++,HTML, CSS,Javascript
--=<> Internet Programming since 1994 <>=-- DHTML NSAPI TCP/IP
--=<> http://resume.drclue.net <>=-- AJAX, SOAP, XML, HTTP
--=<> http://www.drclue.net <>=-- SERVLETS,TCP/IP, SQL
--.


Reply With Quote
  #3  
Old   
Joiey.Seeley@gmail.com
 
Posts: n/a

Default Re: Command Line Parameters - 10-04-2005 , 04:42 PM



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
  #4  
Old   
Evertjan.
 
Posts: n/a

Default Re: Command Line Parameters - 10-04-2005 , 05:06 PM



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

Quote:
Your answer does not seem to apply here.
Please always quote on usenet.
This is not email.

Quote:
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
  #5  
Old   
Joiey.Seeley@gmail.com
 
Posts: n/a

Default Re: Command Line Parameters - 10-04-2005 , 05:54 PM




Evertjan. wrote:
Quote:
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
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.