0

I want to run a system command thru a web application on client side.

so How can I execute a command in javascript to make this work?

Tried using ActiveXObject but its not working, plus it only supports internet explorer. I want something which can run cross browser and execute windows command.

var shell = new ActiveXObject("WScript.Shell"); shell.run("javac a.java");

2
  • 2
    Actually, browsers are built with lots of measures to avoid such a use. Commented Mar 15, 2013 at 11:44
  • Yes, I agree with you... but I can't help it, the requirement is like that. Commented Mar 15, 2013 at 13:44

3 Answers 3

0

Leaving aside the reasons why you might want to do something like this, the only way that I can think of is to create a browser plugin yourself using something like Firebreath. That plugin can then expose a JavaScript interface to the page that can execute whatever code you want on the client machine.

Sign up to request clarification or add additional context in comments.

Comments

0

Chrome has an ActiveXObject plugin but other than that I have found nothing. Due to the inherent security flaws with ActiveXObjects they are usually discouraged.

2 Comments

there are two browsers I need application to be working with (IE and firefox) or just lets focus on firefox, is there anyway you can open it.
No. ActiveX was purely intended for MS products.
0

First of all, what is the scenario for which there is need to call system command?

What I guess there is need to execute some command on server as seems from the code in question.

So, better approach would be to call code behind and execute system commands from code (Java or .Net). For Java, you might find this link useful. For other languages, it can be google'd.

2 Comments

I understand... We can do it on server side... but what I want is actually open an access application which is shared between users. I've that path, I can open it on server but if I do that when user clicks on link, access application is opened on server. I want it to be opened on client. hope I've cleared the question.
Check the following Question/Answer: stackoverflow.com/questions/2537772/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.