简体   繁体   English

没有ActiveX,是否可以在JS / html中运行批处理文件?

[英]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.

相关问题 是否有可能运行一个简单的html在android上调用js文件? - is it possible to run a simple html that calls a js file on android? 如何通过js或批处理文件自动启用IE中的“初始化和脚本未标记为安全脚本(ActiveXObject)的activex控件” - How to enable “initialize and script activex controls not marked as safe for scripting(ActiveXObject)” in IE automatically through js or batch file 是否可以为 2 个 HTML 使用 1 个 JS 文件? - Is it possible to use 1 JS file for 2 HTML? 是否可以在没有输入文件的情况下从文件名加载带有JS / HTML5 FileReader的文件? - Is it possible to load a file with JS/HTML5 FileReader from filename without input file? 是否可以在没有 Ajax 的 Django 的 HTML 模板中从 JS 文件调用声音? - Is it possible to invoke sound from the JS file in Django's HTML template without Ajax? 是否可以在 HTML 中的“onclick”上运行 .exe 或 .bat 文件 - Is it possible to run an .exe or .bat file on 'onclick' in HTML 通过Bash运行HTML文件? 可能? - Run HTML file via Bash? Possible? 是否可以在服务器上运行带有 HTML 的 PHP 文件 - Is it possible to run a PHP file with HTML on the server 是否可以通过JS发布不带表单的文件? - Is it possible to post a file by JS without a form? 如何从 HTML 页面运行 TestNG 批处理文件 - How to run a TestNG batch file from an HTML page
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM