windows - 读取 Internet Explorer 保护模式注册表

标签 windows internet-explorer vbscript registry protected-mode

我正在一边学习注册表,一边使用 vbscript。我想知道是否可以通过使用 vbscript 检查 Internet Explorer 保护模式功能的 strValunamedwValue

我尝试在 strKeyPath 上搜索注册表但无济于事。我也找不到

的注册表路径
"HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System\EnableMIC"

当我找不到上述注册表位置时,我正在使用 windows7。

谢谢

最佳答案

这是一个小的 vbs 脚本,它禁用所有四个区域的保护模式:

Const HKEY_CURRENT_USER = &H80000001

strComputer = "."

Set ScriptMe=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _
    strComputer & "\root\default:StdRegProv")

'Disable protected mode for local intranet'
strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\1\"
strValueName = "2500"
dwValue = 1
ScriptMe.SetDWORDValue HKEY_CURRENT_USER,strKeyPath,strValueName,dwValue

'Disable protected mode for trusted pages'
strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2\"
strValueName = "2500"
dwValue = 3
ScriptMe.SetDWORDValue HKEY_CURRENT_USER,strKeyPath,strValueName,dwValue

'Disable protected mode for internet'
strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3\"
strValueName = "2500"
dwValue = 3
ScriptMe.SetDWORDValue HKEY_CURRENT_USER,strKeyPath,strValueName,dwValue

'Disable protected mode for restricted sites'
strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\4\"
strValueName = "2500"
dwValue = 3
ScriptMe.SetDWORDValue HKEY_CURRENT_USER,strKeyPath,strValueName,dwValue

保存为*.vbs文件,双击运行。从命令行使用此命令:

cscript.exe PATH_TO_THE_VBS_FILE

最后,如果您想在注册表中使用 regedit 手动执行此操作,0 启用,3 禁用,以下文件夹中名为 2500 的 DWORD:

本地 Intranet 的保护模式

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\1\

受信任页面的保护模式

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\2\

互联网保护模式

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3\

受限站点的保护模式

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\4\

关于windows - 读取 Internet Explorer 保护模式注册表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5255942/

相关文章:

c# - 获取鼠标光标图像位置

vbscript - 使用 vbscript 在单独的进程中启动 Internet Explorer 8

file - 比较文件名并将其复制到 Vbscript 后结束循环

vbscript - 从 URL 读取文件

Java 文件 mkdir 给出错误的结果

c++ - OpenCV 和 namedWindow 的窗口大小不一致

windows - 磁盘存储警报电子邮件 - Powershell

javascript - 我在使用 limitkeypress.js 和 IE10 时遇到问题

css - Internet Explorer 中缺少菜单项

javascript - 奇怪的 IE 行为 : currentStyle returns null