Как получить значение реестра на виртуальной машине

#java #regex #virtual-machine

#java #регулярное выражение #виртуальная машина

Вопрос:

У меня есть код, запущенный на виртуальной машине, и я хочу получить реестр на этой машине. Но ничего из этого не работает:

 //First opinion
Preferences p = Preferences.userRoot();
    System.out.println("xx "   p.nodeExists("HKEY_LOCAL_MACHINE\SOFTWARE\Autotask Corporation\Workplace\Capabilities\ApplicationName"));

//Second opinion
Preferences r = Preferences.systemRoot();
System.out.println("yy "   r.nodeExists("HKEY_LOCAL_MACHINE\SOFTWARE\Autotask Corporation\Workplace\Capabilities\ApplicationName"));

//Third opinion
String value = WinRegistry.getString (
                WinRegistry.HKEY_LOCAL_MACHINE,                                         //HKEY
                "SOFTWARE\Autotask Corporation\Workplace\Capabilities",           //Key
                "ApplicationName");                                                 //ValueName
System.out.println("Windows Distribution = "   value);

//Fourth opinion
WindowsRegistry reg = WindowsRegistry.getInstance();
String tree = "SOFTWARE\Autotask Corporation\Workplace\Capabilities";
try {
    String automationPortString = reg.readString(HKey.HKLM, tree, "ApplicationName");
}catch (RegistryException e){
    logger.info(e);
}
  

Вывод:

 xx false
yy false
Windows Distribution = null
com.github.sarxos.winreg.RegistryException: Cannot read ApplicationName value from key SOFTWAREAutotask CorporationWorkplaceCapabilities
  

Реестр:

Мой реестр