开发者

VB script + OPEN file.html and perform "allow blocked content" auto

开发者 https://www.devze.com 2023-01-10 23:24 出处:网络
When I open the开发者_高级运维 file.html by MyShell = CreateObject(\"WScript.Shell\"), I also need to enable the \"allow blocked content\".

When I open the开发者_高级运维 file.html by MyShell = CreateObject("WScript.Shell"), I also need to enable the "allow blocked content".

Is it possible to do the "allow blocked content" by VB script after VB opened the html page?


Nope, that's not possible for security reasons IE considers, that is something there with the browser (IE), you can not enable it programmatically.


set objShell = CreateObject("WScript.Shell") 

objShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\Enable Browser Extensions","yes", "REG_SZ" 
objShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_LOCALMACHINE_LOCKDOWN\iexplore.exe","00000000", "REG_DWORD" 

Run the above VBScript. Hope this helps.


That permission request pop up then load offline .html's in IE. Better use HTAs in this case. They have the permission, so not necessary any special setup.

0

精彩评论

暂无评论...
验证码 换一张
取 消