[英]Is it at all possible to run a batch file in JS / html without ActiveX?
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. 该站点基本上会测试他们的Internet连接,然后再连接到我们的网络。 If they are not connected to out network, we currently have it directing to our VPN sign in page. 如果他们没有连接到外部网络,那么我们目前会将其定向到我们的VPN登录页面。 I also have code that will run a batch file which runs out networkconnect.exe with activeX (Which would be much easier). 我也有将运行批处理文件的代码,该批处理文件将用activeX用尽networkconnect.exe(这会容易得多)。 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. 但是,在本地站点上使用activex时,会出现警报,提示您在站点首次启动时允许activeX,用户必须单击“确定”才能起作用。 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? 如此说来,有没有办法运行不使用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! (我知道使用JS运行批处理文件是一个巨大的安全问题,因此即使有一种“自动允许来自站点'x'的Activex”的方法也可以使用。谢谢!
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. 想象一下,是否有人可以运行包含用于删除用户的Downloads
文件夹的代码的批处理文件。
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) (不幸)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.