Меню Рубрики

Windows regcreatekeyex returned error code 5

Java warning: «WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs. » #1

Comments

Copy link Quote reply

julienvollering commented Feb 10, 2017

When using one of the MIAmaxent functions that relies on the maxent.jar software (e.g. deriveVars, selectDVforEV, selectEV, plotResp), some users have reported the appearance of the following waring message:
«WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(. ) returned error code 5.»

julienvollering commented Feb 10, 2017

This is a known java issue, and may be solved by following the procedure suggested by MKorsch on StackOverflow (http://stackoverflow.com/questions/16428098/groovy-shell-warning-could-not-open-create-prefs-root-node):

«1. Go into your Start Menu and type regedit into the search field.
2. Navigate to path HKEY_LOCAL_MACHINE\Software\JavaSoft (Windows 10 seems to now have this here: HKEY_LOCAL_MACHINE\Software\WOW6432Node\JavaSoft)
3. Right click on the JavaSoft folder and click on New -> Key
4. Name the new Key Prefs and everything should work.»

bbottema commented Nov 3, 2017

Above method solved it for me (executing FindBugs from Maven) under Windows 10 (with HKEY_LOCAL_MACHINE\Software\JavaSoft).

avineela commented Dec 1, 2017

Above method solved it for me (executing FindBugs from Maven) under Windows 10 (with HKEY_LOCAL_MACHINE\Software\JavaSoft).

ooluwadeyi commented Dec 11, 2017

This method worked for me too.
Thanks

taigemao commented Jan 1, 2018

@julienvollering Thank you, it works for me. But I actually added new keys to both locations 🙂

amcilwee commented Jan 5, 2018

Thank you. worked for me, but I’m not sure why I get the following error when I run the line:

Источник

RegCreateKeyExA function (winreg.h)

Creates the specified registry key. If the key already exists, the function opens it. Note that key names are not case sensitive.

To perform transacted registry operations on a key, call the RegCreateKeyTransacted function.

Applications that back up or restore system state including system files and registry hives should use the Volume Shadow Copy Service instead of the registry functions.

Syntax

Parameters

A handle to an open registry key. The calling process must have KEY_CREATE_SUB_KEY access to the key. For more information, see Registry Key Security and Access Rights.

Access for key creation is checked against the security descriptor of the registry key, not the access mask specified when the handle was obtained. Therefore, even if hKey was opened with a samDesired of KEY_READ, it can be used in operations that modify the registry if allowed by its security descriptor.

This handle is returned by the RegCreateKeyEx or RegOpenKeyEx function, or it can be one of the following predefined keys:

HKEY_CLASSES_ROOT HKEY_CURRENT_CONFIG HKEY_CURRENT_USER HKEY_LOCAL_MACHINE HKEY_USERS

The name of a subkey that this function opens or creates. The subkey specified must be a subkey of the key identified by the hKey parameter; it can be up to 32 levels deep in the registry tree. For more information on key names, see Structure of the Registry.

If lpSubKey is a pointer to an empty string, phkResult receives a new handle to the key specified by hKey.

This parameter cannot be NULL.

This parameter is reserved and must be zero.

The user-defined class type of this key. This parameter may be ignored. This parameter can be NULL.

This parameter can be one of the following values.

This key is a symbolic link. The target path is assigned to the L»SymbolicLinkValue» value of the key. The target path must be an absolute registry path.

Value Meaning
REG_OPTION_BACKUP_RESTORE 0x00000004L If this flag is set, the function ignores the samDesired parameter and attempts to open the key with the access required to backup or restore the key. If the calling thread has the SE_BACKUP_NAME privilege enabled, the key is opened with the ACCESS_SYSTEM_SECURITY and KEY_READ access rights. If the calling thread has the SE_RESTORE_NAME privilege enabled, beginning with WindowsВ Vista, the key is opened with the ACCESS_SYSTEM_SECURITY, DELETE and KEY_WRITE access rights. If both privileges are enabled, the key has the combined access rights for both privileges. For more information, see Running with Special Privileges.
REG_OPTION_CREATE_LINK 0x00000002L
REG_OPTION_NON_VOLATILE 0x00000000L This key is not volatile; this is the default. The information is stored in a file and is preserved when the system is restarted. The RegSaveKey function saves keys that are not volatile.
REG_OPTION_VOLATILE 0x00000001L All keys created by the function are volatile. The information is stored in memory and is not preserved when the corresponding registry hive is unloaded. For HKEY_LOCAL_MACHINE, this occurs only when the system initiates a full shutdown. For registry keys loaded by the RegLoadKey function, this occurs when the corresponding RegUnLoadKey is performed. The RegSaveKey function does not save volatile keys. This flag is ignored for keys that already exist.

A mask that specifies the access rights for the key to be created. For more information, see Registry Key Security and Access Rights.

A pointer to a SECURITY_ATTRIBUTES structure that determines whether the returned handle can be inherited by child processes. If lpSecurityAttributes is NULL, the handle cannot be inherited.

The lpSecurityDescriptor member of the structure specifies a security descriptor for the new key. If lpSecurityAttributes is NULL, the key gets a default security descriptor. The ACLs in a default security descriptor for a key are inherited from its direct parent key.

A pointer to a variable that receives a handle to the opened or created key. If the key is not one of the predefined registry keys, call the RegCloseKey function after you have finished using the handle.

A pointer to a variable that receives one of the following disposition values.

Value Meaning
REG_CREATED_NEW_KEY 0x00000001L The key did not exist and was created.
REG_OPENED_EXISTING_KEY 0x00000002L The key existed and was simply opened without being changed.

В

If lpdwDisposition is NULL, no disposition information is returned.

Return value

If the function succeeds, the return value is ERROR_SUCCESS.

If the function fails, the return value is a nonzero error code defined in Winerror.h. You can use the FormatMessage function with the FORMAT_MESSAGE_FROM_SYSTEM flag to get a generic description of the error.

Remarks

The key that the RegCreateKeyEx function creates has no values. An application can use the RegSetValueEx function to set key values.

The RegCreateKeyEx function creates all missing keys in the specified path. An application can take advantage of this behavior to create several keys at once. For example, an application can create a subkey four levels deep at the same time as the three preceding subkeys by specifying a string of the following form for the lpSubKey parameter:

Note that this behavior will result in creation of unwanted keys if an existing key in the path is spelled incorrectly.

An application cannot create a key that is a direct child of HKEY_USERS or HKEY_LOCAL_MACHINE. An application can create subkeys in lower levels of the HKEY_USERS or HKEY_LOCAL_MACHINE trees.

If your service or application impersonates different users, do not use this function with HKEY_CURRENT_USER. Instead, call the RegOpenCurrentUser function.

Note that operations that access certain registry keys are redirected. For more information, see Registry Virtualization and 32-bit and 64-bit Application Data in the Registry.

The winreg.h header defines RegCreateKeyEx as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.

Источник

Твой Сетевичок

Все о локальных сетях и сетевом оборудовании

Системная ошибка 5 отказано в доступе windows 7 — что делать?

Системная ошибка 5 с сообщением «отказано в доступе» является универсальной и может возникать по целому ряду причин, связанных с отсутствием доступа у пользователя к различным объектам. Иногда это происходит даже если его учетная запись входит в группу администраторов.

Почему возникает system error code 5 отказано в доступе?

Наиболее распространённая причина связана с механизмом контроля учетных записей ( user access control – UAC ), который появился еще в Windows Vista и перешел по наследству во все последующие ОС этого семейства, включая Windows 7.

Следующей причиной является недостаточные права на объекты файловой системы, которые также стали встречаться в файловых системах, которые используются в Windows 7 по умолчанию. Называется она NTFS . До этого — в Windows XP — ставилась файловая система FAT32, в которой не было реализовано никаких механизмов разграничения прав пользователей.

Третий — самый редкий для пользователя вариант – это отсутствие прав доступа на конкретные системные объекты, такие, например, как службы. При попытке приложения, запускаемого под учетными данными, имеющими ограничения, ошибка будет возникать для пользователя как бы сама собой.

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

Как исправить system error code 5 «отказано в доступе»?

Запуск от имени администратора

Предположим, пользователь закачал инсталлятор для игры, стартовал его и получил такое окно с сообщением об ошибке: « Error 5: Отказано в доступе».

Самым простым временным и, вместе с тем, действенным способом будет запуск этого же инсталлятора от имени учетной записи администратора. Для этого следует на значке программы установщика нажать на правую кнопку мышки и в появившемся меню выбрать пункт: «запуск от имени администратора».

Поскольку пользователь не входит в администраторскую группу, то необходимо будет ввести пароль одного из пользователей, обладающих такими правами.

После этого запуск программы выполнится успешно.

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

Предоставление доступа к папке

В приведенном примере видно, что причиной сбоя с кодом 5 было отсутствие доступа к папке временных файлов. Приложение пытается использовать временную папку по системным переменным, а не по пользовательским.

Поскольку приложение не скорректируешь, то можно предоставить такой доступ на уровне файловой системы пользовательской учетной записи. Для этого необходимо открыть проводник под администратором.

Кликнуть на значке проводника правой кнопкой мыши, затем на приложении и выбрать в появившемся меню пункт «запуск от имени администратора».

В появившемся окне найти папку, на которую ссылалась ошибка на самом первом скриншоте : «C:\ Windows \ Temp ». На самой папке нажать правую кнопку мыши и выбрать в меню пункт «свойства».

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

Для добавления учетной записи « user » необходимо нажать на кнопку «добавить». Появится окно, в котором пишется имя пользователя « user ».

Последующим нажатием кнопки «проверить имена» происходит поиск имени записи и подстановка ее полного пути. После нажатия на кнопку «OK», окно закрывается.

В списке пользователей теперь появляется « user », и в его правах по умолчанию выделены несколько разрешений. Убеждаемся, что есть права на запись и изменение и, если их нет, проставляем соответствующие чекбоксы. Права на чтение, выполнение и просмотра папки также следует выделить. Как правило, они отмечены по умолчанию.

После этого следует нажать на кнопку «применить». Появится предупреждение, с которым следует согласиться.

Процесс применения прав займет некоторое время. После его выполнения все окна, в которых выполнялась настройка предоставления прав следует закрыть.

Что запомнить пользователям

После выполнения второго действия можно запускать установщики даже под пользовательской учетной записью. Возможно, что устанавливаемому приложению потребуется доступ также и к другим папкам. Его можно предоставить тем же способом. Не всегда ошибка по доступу бывает связана с разрешениями файловой системы. На уровне политик безопасности пользователям может быть запрещен запуск любых инсталляторов . В этом случае первый способ – запуска от имени администратора будет универсальным.
Разграничение на уровне доступа создано исключительно с целью повышения безопасности и надежности работы системы. Правильно выполнять все работы по установке и настройке программ под администраторскими учетными записями, а саму работу с приложением выполнять в качестве обычного пользователя.

Источник

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *

  • Windows recovery environment что это такое
  • Windows recovery environment как войти в
  • Windows r operating system retail channel
  • Windows putty network error connection refused
  • Windows push button reset hp как запустить