简体   繁体   English

如何通过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

According to my requirement I need to implement a filesystem using ActiveXObject in IE. 根据我的要求,我需要在IE中使用ActiveXObject实现一个文件系统 I implemented the same but difficulty is that to ask users to enable the "initialize and script activex controls not marked as safe for scripting" option manually from Internet options . 我实现了相同但困难的是要求用户从Internet选项手动启用“初始化和脚本activex控件未标记为可安全编写脚本”选项。 So can anyone please suggest me how to enable the same via coding(Javascript or batch). 所以任何人都可以建议我如何通过编码(Javascript或批处理)启用相同的功能。

NOT An Answer or solution, just some guidance based on brief experience in similar area. 不是答案或解决方案,只是基于类似领域的简要经验的一些指导。 IE-11 doesn't allow ActiveX object anyway to be used directly unless IE security settings are lowered as you mentioned. IE-11不允许直接使用ActiveX对象,除非你提到的IE安全设置降低了。 Develop a plugin instead and have your users to install this plugin as a prerequisite to use your application. 改为开发插件并让用户安装此插件作为使用您的应用程序的先决条件。

Alternatively, here's a way you can try to instantiate an ActiveX object in your javascript BUT again this may well need IE settings to be manually set to allow ActiveX to be invoked or to run this javascript. 或者,这里有一种方法可以尝试在javascript中再次实例化ActiveX对象但是这可能需要手动设置IE设置以允许调用ActiveX或运行此javascript。 You may need test this out. 您可能需要对此进行测试。

 xx 

  try { var shellObj = new ActiveXObject("WScript.Shell"); var clsid = "xxxxxxxx-xxxx-xxxx-xxxx-000000000000"; var progid = shellObj.RegRead("HKEY_CLASSES_ROOT\\\\CLSID\\\\{" + clsid + "}\\\\ProgID\\\\"); var plugin = new ActiveXObject(progid); if (plugin) { //whatever you want to achieve } else { return null; } } 

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在读取XLS / XLSX本地文件时,如何使用IE的JavaScript代码启用未标记为安全的ActiveX控件 - How to enable ActiveX controls not marked as safe using javascript code for IE, while reading XLS/XLSX local files 如何在无需实例化ActiveXObject的情况下在IE 8/9/10中检测ActiveX控件 - How to detect ActiveX controls in IE 8/9/10 without having to instantiate ActiveXObject 如何在使用JavaScript的情况下启用ActiveX控件 - How to enable activex controls in ie using javascript IE ActiveX' FileSystemObject - 如何使用 JS 读取本地文件 - 帮助 - IE ActiveX' FileSystemObject - how to read local file with JS - help 如何通过IE 7和8浏览器访问OS中的文件系统,而不使用ActiveXObject? - How to access file system in os by IE 7, and 8 browser ,without using ActiveXObject? 如何修改ActiveXObject JS构造函数? - How to modify ActiveXObject JS constructor? 如何在不使用新的ActiveXObject()的情况下测试ActiveX控件? - How can I test for an ActiveX control without using new ActiveXObject()? 没有ActiveX,是否可以在JS / html中运行批处理文件? - Is it at all possible to run a batch file in JS / html without ActiveX? 在IE中禁用ActiveX特定的ocx(或特定的ActiveX控件) - Disabling ActiveX a specific ocx (or specific ActiveX controls) in IE 如何在不支持ActiveXObject的情况下使用Javascript / JQuery在文本文件中写入数据,因为它仅支持IE? - How to write data in text file using Javascript/JQuery without ActiveXObject as it supports only IE?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM