1

So, here's my dilemma, I'm creating a site for the company I work for to push out to all our remote employees. The site basically tests their internet connection and then connection to OUR network. If they are not connected to out network, we currently have it directing to our VPN sign in page. I also have code that will run a batch file which runs out networkconnect.exe with activeX (Which would be much easier). HOWEVER, with activex on a local site, an alert comes up prompting to allow activeX when the site it first launch that the user will have to click "OK" for it to work. While this seems like a small issue that can be looked over, my boss has stressed that we cannot have them click "OK" as a good percentage will likely close it our or disregard completely.

So with that said, is there ANY way to run a batch file that wouldn't user activeX? I'm fairly new to coding so go easy on me. (I understand running a batch file with JS is a huge security concern, so even if there were a way to "auto allow activex from site 'x' " that would also work. Thanks!

1 Answers1

1

That will be a very big security issue. Imagine if someone could run a batch file containing the code to delete Downloads folder of the user.

Still, you can do this:

<button onclick="window.open('file:///C:/Windows/hello.bat')">
Hello
</button>

But this won't work on a webserver!!! (Unfortunately)

Arjun
  • 1,261
  • 1
  • 11
  • 26
  • Dear @Arjun this command that you write only open the batch file, I need a `javascript` command that `Run` a `local` batch file by `onload page event`. I know that `ActiveXObject` but it applies only for IE browser and it is not applicable for `Chrome`. Could you please help me? – Hosein Aqajani Dec 09 '15 at 10:18
  • @H.Aqjn `` :) – Arjun Dec 10 '15 at 11:20
  • Dear @Arjun 2 I want to `Run a batch file` not `open a batch file` – Hosein Aqajani Dec 13 '15 at 05:13