in x64 Windows is there a way to run a Runtime.exec() process avoiding 'Registry redirection'

馋奶兔 提交于 2019-12-24 03:49:09

问题


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.

I do this by executing

cmd /C reg query HKEY_LOCAL_MACHINE\SOFTWARE\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

Any idea?


回答1:


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



来源:https://stackoverflow.com/questions/2416796/in-x64-windows-is-there-a-way-to-run-a-runtime-exec-process-avoiding-registry

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!