I am trying to change the Access Control permissions on a specific registry key i'm generating using a batch file. I try using regini.exe to pull the configuration from a .ini file and run into issues.
I keep getting this error:
Z:\EM\Pre>regini.exe RegistryPermissions.ini
REGINI: CreateKey (\HKEY_CURRENT_CONFIG\Software\E) relative to handle (000000000) failed - 161
REGINI: Failed to load from file 'RegistryPermissions.ini' (161)
This is the contents of my .ini file RegistryPermissions.ini:
Computer\HKEY_CURRENT_CONFIG\Software\E [1 7]
This is the batch script i'm writing to solve a problem:
@echo off
:: ==========================================
:: Set E Key
:: ==========================================
:: Date : 11 October 2019
:: Author :
:: Modified Date:
:: Modified By:
::
:: Script Details:
:: --------------
:: This script will:
:: + add the E Registry key to HKCC\Software
:: + set the Key permissions to allow "Everyone" full control
:: + reboot PC
:: ===========================================
::***************************************************************
:: Add E Registry Key to HKCC\Software *
::***************************************************************
REG ADD HKCC\Software\E
::***************************************************************
:: Set the Key to permissions to allow Everyone full control *
::***************************************************************
=====This is where I need help=====
::***************************************************************
:: Reboot PC *
::***************************************************************
goto end
:end
I have removed some unnecessary sections of the script. The important part is changing the permissions on a registry key, with cmd.