I cannot find a way to grant access to Windows Registry key using VBS
or BAT
.
This link doesnot help https://technet.microsoft.com/en-us/library/cc728310(v=ws.10).aspx
Any clue?
windows 7windows-registry
I cannot find a way to grant access to Windows Registry key using VBS
or BAT
.
This link doesnot help https://technet.microsoft.com/en-us/library/cc728310(v=ws.10).aspx
Any clue?
Best Answer
I found great answer here https://stackoverflow.com/questions/10854772/how-can-i-use-vbscript-to-add-or-change-permissions-on-a-registry-key
To use a script to change permissions defined in a registry key from a command prompt:
Install the latest version of the Windows NT Server 4.0 Resource Kit. Create a script file that contains the change commands: Start any text editor (such as Notepad). Type the registry keys and the appropriate permissions in the following format \Registry\hive\key [permissions] where hive is the name of the registry hive, key is the name of the registry key, and [permissions] is the binary number format of the permissions.
For example, to modify the HKEY_LOCAL_MACHINE\Software registry key to give the Administrators group and the Creator/Owner group Full Control permission and the Everyone group Read permission, type the following string: \Registry\Machine\Software [1 5 8] NOTE: You must type the permissions in the binary number format. You must also refer to the registry hive in the predefined format. For more information about how to refer to a registry hive in a script file and about the binary numbers for various types of permissions, refer to the 'Reference to Registry Hives and Binary Number Representation for Permissions' section in this article. Save and then close the script file. Type the following command at a command prompt, and then press ENTER REGINI [-m \computername] scriptname where computername is the name of the computer and scriptname is the name of the script file you just created.
NOTE: Use the -m option only when you edit the registry of a remote computer. Be sure to include the entire path to the script file. Reference to Registry Hives and Binary Number Representation for Permissions
Refer to registry hives as indicated below:
user's security identifier)
Permissions and their binary number representations are as follows:
You can use the Regdmp utility, also included with the Resource Kit, to obtain the current permissions of a registry key in the binary number format.