473,399 Members | 3,401 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,399 software developers and data experts.

How to execute parameterized command using java script?

rahuljaiswal1987
Videoagent.exe -s 100.100.10.1 -c 3 -d 08252002 -b 14:12:35 -e 14:15:12 -u USERID -p PASSWORD


This is a command to execute video agent with these parameter. I want to execute this command through javascript. Tell me some solution if you have.
Apr 8 '10 #1
16 4032
Dormilich
8,658 Expert Mod 8TB
I have none and I will never have. JavaScript cannot get out of its browser sandbox.
Apr 8 '10 #2
I have got the soln.


Expand|Select|Wrap|Line Numbers
  1. var oShell = new ActiveXObject("Shell.Application");
  2. var commandtoRun = "C:\\Program Files\\Sensormatic\\NetworkClient\\Bin\\VideoAgent.exe";
  3. var commandParms = "-s 0.0.0.0 -t 5000 -c 5 -d 04042010 -b 14:12:35 -e 14:15:12";
  4. oShell.ShellExecute(commandtoRun, commandParms, "", "open", "1");


rEGARDS,

rAHUL
Apr 8 '10 #3
Dormilich
8,658 Expert Mod 8TB
that will only work in IE.
Apr 8 '10 #4
I know but is thr any way so that it can work for other browsers too.
Apr 9 '10 #5
Dormilich
8,658 Expert Mod 8TB
nope. that would be too high a security risk.
Apr 9 '10 #6
Is there any alternative to ShellExecute() method?
Apr 9 '10 #7
Dormilich
8,658 Expert Mod 8TB
as I already said, JavaScript (unlike JScript) does not have any access to the local file system.
Apr 11 '10 #8
I don't know at this time that whetjer its possible or not, but i totally disagree with your 2nd statement that "JavaScript does not have any access to the local file system."
Apr 12 '10 #9
Dormilich
8,658 Expert Mod 8TB
@rahuljaiswal1987
that’s your opinion. but don’t complain, if you should fail afterwards.
Apr 12 '10 #10
its not ma openion its fact. nd i'll neve fail.
Apr 12 '10 #11
Try this link:
http://wareseeker.com/download/shell....00.rar/403362
download and use it.
Apr 12 '10 #12
Dormilich
8,658 Expert Mod 8TB
*lol*

that’s not JavaScript and, if you didn’t notice, it’s Windows only.
Apr 12 '10 #13
If u want to execute this in mozilla then try this. In address bar, type:
about:config

It list lot of configs, from those select
signed.applets.codebase_principal_support
change its value as true

Then execute the script. I am not sure but try this.
Apr 12 '10 #14
Still its not workin but thanks for your reply Pandian.
Apr 12 '10 #15
Try this Link...
htt://www.mozilla.org/rhino/shell.html
Apr 12 '10 #16
Dormilich
8,658 Expert Mod 8TB
that is JavaScript via CLI (command line interface). it does not enable you to run applications from a website (as stated on the page).
Apr 12 '10 #17

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Laura P | last post by:
Hi, I wasn't sure whether this should be posted in the Java are or in a Solaris thread, so I shall post it in both. Sorry for the duplication. I am new to Solaris and am having trouble...
0
by: Nashat Wanly | last post by:
HOW TO: Call a Parameterized Stored Procedure by Using ADO.NET and Visual C# .NET View products that this article applies to. This article was previously published under Q310070 For a Microsoft...
1
by: gary b | last post by:
Hello When I use a PreparedStatement (in jdbc) with the following query: SELECT store_groups_id FROM store_groups WHERE store_groups_id IS NOT NULL AND type = ? ORDER BY group_name
7
by: William Gill | last post by:
I have been trying to pass parameters as indicated in the api. when I use: sql= 'select * from %s where cusid = %s ' % name,recID) Cursor.execute(sql) it works fine, but when I try : sql=...
1
by: Matt | last post by:
I used to execute a command line script in IIS 4 using Dynuexec. This is a third part server object I installed on the server (http://www.dynu.com/dynuexec.asp). I installed this object onto my...
10
by: Sean Dockery | last post by:
I have the following HTML file that I've been using for testing... <html> <head> <script type="text/javascript"> <!-- function handleWindowLoad() { var items = ; for (var i = 0; i < 11; i++)...
5
by: Good Man | last post by:
Hi there I am trying to execute a custom-built java program on my linux server via PHP. Basically, a user uploads files via PHP, and then the java program performs some action on these files. ...
14
by: technocrat | last post by:
db2 -t -v -f/home.../filename >output_file-name I have a java stored procedure..which has to run the above command...not sure how i can run this command through java.. any suggestions are...
0
by: dappyl | last post by:
Hi,... I have an example shell script to run command prompt. It works fine.. the code shown below : <% Dim wshell, intReturn set wshell = server.createobject("wscript.shell") intReturn...
4
by: Chr1s | last post by:
How do I execute a crontab command using php (not CLI) as user Joe? I don't have any problem getting output from commands such as 'ls' using passthru and exec but I am stumped with crontab. ...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...

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.