在 x64 Windows 中,有没有办法运行 Runtime.exec() 进程,避免“注册表重定向" [英] in x64 Windows is there a way to run a Runtime.exec() process avoiding 'Registry redirection'

查看:47
本文介绍了在 x64 Windows 中,有没有办法运行 Runtime.exec() 进程,避免“注册表重定向"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的应用程序在 jvm 32 位中运行,即使在 windows x64 中也是如此.现在,在某些时候,我需要访问一些注册表值,例如 HKEY_LOCAL_MACHINE/SOFTWARE/mycomp.

Our app runs in jvm 32 bit, even when in windows x64. Now, at some point, I need to access some registry values, for example HKEY_LOCAL_MACHINE/SOFTWARE/mycomp.

我通过执行

cmd /C reg query HKEY_LOCAL_MACHINE\SOFTWARE\mycop

来自 Runtime.exec() 并解析输出.这在 windows 32b 上运行时很好用,问题是在 x64 上,我找不到密钥,因为我运行的 shell 是一个 32 位进程,并且由于 注册表重定向 如果它在 HKEY_LOCAL_MACHINE/SOFTWARE/wow6432Node/mycop 上,我会得到密钥

from Runtime.exec() and parsing the output. This works fine when running on windows 32b, the problem is when on x64, I cannot find the key, as the shell I run is a 32 bit process, and due to Registry Redirection I would get the key if it was on HKEY_LOCAL_MACHINE/SOFTWARE/wow6432Node/mycop

有什么想法吗?

推荐答案

万一有人尝试这个...我无法做到这一点,不得不求助于我的方案支持的另一种方法.

In case anybody tries this...I was not able to do this and had to resort to another approach that my scenario supported.

这篇关于在 x64 Windows 中,有没有办法运行 Runtime.exec() 进程,避免“注册表重定向"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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