473,405 Members | 2,445 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Command Line Parameters

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 '05 #1
4 6522
Jo**********@gmail.com wrote:
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
--.
Oct 4 '05 #2
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 '05 #3
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)

Oct 4 '05 #4

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 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Naina | last post by:
Hi , I am trying to read parameters from the command line. I enter -instrType"S2234".I need to extract s2234 and store in Say $test. I am able to separate -instrType as shown below ,but I am...
5
by: Bruno Alexandre | last post by:
Hi guys, withou using SP, I want to be able to add a Parameter to the SQL Query and retrive the Recordset so I can use the Paging property under the recorset object.... how can I do this? I'm...
2
by: Erik Wikström | last post by:
This is probably a stupid question but is there any easy way to get the command line parameters in a windows form? As it is now I copy the parameters into a statis string array belonging to the...
1
by: mriedel | last post by:
I'm using the InstallContext class to parse the command-line arguments of a console application. The arguments are in the form of "-file=myFile.txt -flag", and the InstallContext object gives me what...
1
by: amirmira | last post by:
I would like to set command line arguments to a service at install time. I need to do this because I need to get information from different registry locations depending on my command line argument....
1
by: slonocode | last post by:
I have created a filter in Eudora email program that will notify a program when the criteria is met. For instance if the filter criteria is met it will send the following command: ...
5
by: clsmith66 | last post by:
I've been asked to find out if a project is possible, but I'm not having much luck finding the information I need, I hope some one can help. I need to see if I can build a windows service on the...
8
by: djc | last post by:
I'm new to this and was wondering what the options are for interpreting the command line using a CLI program. Specifically methods for interpreting the parameters passed to the program on the...
16
by: John Salerno | last post by:
Here's my new project: I want to write a little script that I can type at the terminal like this: $ scriptname package1 where scriptname is my module name and any subsequent arguments are the...
2
by: explode | last post by:
I made nova oledbdataadapter select update insert and delete command and connection veza. dataset is Studenti1data, I made it by the new data source wizard,and made datagridview and bindingsource...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.