Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ InTouch HMI

读写注册表。

  • Last UpdatedSep 24, 2024
  • 1 minute read

在脚本中,可以通过以下方法使用 OLE 对 Windows 注册表进行读写:

  • 基于 Windows 类 Wscript.Shell 创建 OLE 对象。

  • 使用 OLE 对象的 RegRead() 与 RegWrite() 方法。

例如,这些命令直接从注册表键读取安装的 InTouch HMI 的版本,然后将值存储到 rkey 消息标记名:

OLE_CreateObject(%WS,"Wscript.Shell");

rkey = %WS.RegRead("HKLM\SOFTWARE\Wonderware\InTouch\Installation\Version");

这些命令将值 1 写入某个注册表键,该键确定对于当前登录的用户,文件扩展名是否隐藏:

OLE_CreateObject(%WS,"Wscript.Shell");

%WS.RegWrite("HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\HideFileExt",1,"REG_DWORD");