VBS的Windows 64位/ 32位注册表中读取的问题 [英] VBS Windows 64bit/32bit registry read problem

查看:463
本文介绍了VBS的Windows 64位/ 32位注册表中读取的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图实现我觉得应该是相当简单但它是让我完全疯了。

What I am trying to achieve I feel should be fairly simple yet it is driving me totally insane.

背景: 我们跑在我们的客户具有远程运行的.vbs脚本的能力的系统监控工具。这个作品非常好正常。

Background: We run a system monitoring tools across our clients which has the ability to run .vbs scripts remotely. This works very well normally.

我试图达到目前是能够从注册表中读取一个行窗口的两个32位版本和64位版本。

What I am trying to achieve currently is being able to read a line from the registry on both 32bit versions of windows and 64 bit versions.

客户side.exe其监控机器运行的两个平台上32位进程(这是招)。

The Client side.exe which monitors the machine runs as a 32bit process on BOTH platforms (This is the trick).

我想读HKEY_LOCAL_MACHINE \ SOFTWARE \例如密钥。我的脚本工作完全正常的32位。例如:objRegistry.RegRead(HKEY_LOCAL_MACHINE \ SOFTWARE \什么)

I want to read a key from HKEY_LOCAL_MACHINE\SOFTWARE\ for example. My script works perfectly fine on 32bit. example: objRegistry.RegRead("HKEY_LOCAL_MACHINE\Software\anything")

我的问题是,当我运行在64位的文件夹同一行会自动寻找在wow64node文件夹。示例:objRegistry.RegRead(HKEY_LOCAL_MACHINE \ SOFTWARE \ wow64node \)

The problem I have is when I run this same line on a 64bit folder is is automatically looking in the wow64node folder. Example: objRegistry.RegRead("HKEY_LOCAL_MACHINE\Software\wow64node\").

我需要把它检查完全相同的地方。

I need to have it checking in EXACTLY the same place.

这是阅读的关键是同时运行32位和64位版本,这就是为什么它没有安装在wow64node文件夹中的计划的一部分。

The key it is reading is part of a program that runs both 32bit and 64bit versions which is why it is not installed in the wow64node folder.

在这一点上我无法运行.vbs脚本作为一个64位的过程,将解决我的问题,完全是因为它会再不会看在wow64node文件夹。

At this point I am unable to run the .VBS script as a 64bit process which would solve my problem entirely as it would then not look in the wow64node folder.

如果任何人有任何想法都请让我知道。

If anyone has any ideas at all please let me know.

推荐答案

而不是 WshShell.RegRead 中,使用WMI的 的StdRegProv 类—它允许你指定你是否想从32位或64位注册表中读取。看看这个MSDN文章的详细信息和实例:

Instead of WshShell.RegRead, use the WMI StdRegProv class — it allows you to specify whether you want to read from the 32-bit or 64-bit registry. Check out this MSDN article for more info and examples:

在64位平台上的请求WMI数据

这篇关于VBS的Windows 64位/ 32位注册表中读取的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆