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