1

I want to run a batch file which is on my local system using javascript or jquery. ActiveXObject didn't helped me at all. I know it is deprecated, but my system will be in some secured internal network.

8
  • 2
    How should the browser access a batch file on the local harddrive? All browsers should keep you from doing that through their sandboxes Commented Aug 7, 2018 at 12:37
  • 2
    Why exactly didn't ActiveXObject help you? Do you have to run it in Chrome / Firefox etc or just IE? Short answer: besides using ActiveX you can't access the local filesystem via JavaScript using a Webbrowser Commented Aug 7, 2018 at 12:37
  • @NicoHaase I am displaying some data in browser and doing some processing saving it to my db and then I need to pass that data to a standalone desktop and have to open it in that Desktop application, for which I have written a BAT file. How can I achieve this. Commented Aug 7, 2018 at 12:51
  • @r3dst0rm Yes I am using chrome. Commented Aug 7, 2018 at 12:51
  • @zzedpathan Chrome won't support ActiveX, as it's only working in Internet Explorer. Therefore it's simply impossible as JavaScript engines are running in a sandbox. If you do some processing e.g. in Excel, you could prompt the user for a download in order to open the desired file. Commented Aug 7, 2018 at 13:42

1 Answer 1

0

We shouldn't be running any exec or batch file from browser. It is totally deprecated and also browser's are not given the access to OS threads. The best approach to achieve it is to trigger a method in backend (java or C#) and to achieve the same from that method.

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

Comments

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.