Would something like:

reg add HKLM\Software\Microsoft\Windows\CurrentVersion\Run\ /v %keyname% /t REG_SZ /d "%expath%"

require administrator privileges to be able to execute from a batch file?


Whether it requires admin permissions or not, is not the actual question you need to ask.

Registry keys, just like the NTFS file system, have Access Control Lists controlling who has access to that particular key.

You can check the permissions of the registry key by right-clicking it in regedit and choosing properties. If the user or group you intend to run the batch file under does not have appropriate access to the key, it will not be able to modify it. It’s possible that even the administrator doesn’t have access to the key.

Typically, HKLM is the computer wide settings that require admin permissions. The HKCU key is per user and the user usually has full control on those keys.

More info here: https://docs.microsoft.com/en-us/windows/desktop/sysinfo/registry-key-security-and-access-rights

| improve this answer | |
  • So how can one edit the key if the admin does not have perms? – Raymo111 Oct 27 '18 at 19:36
  • @Raymo111 The admin takes ownership and changes the permissions. The admin can do that. – Appleoddity Oct 27 '18 at 19:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.