Link to home
Start Free TrialLog in
Avatar of advcom
advcom

asked on

Need vbscript or VB6 code to grant full access to everyone on a registry key, not using an exe such as subinacl

I need visual basic 6 or vbscript code example on how to grant a registry key full access to the everyone group. I can do this using subinacl with this command:
subinacl /subkeyreg HKEY_LOCAL_MACHINE\system\currentcontrolset\services\UACd.sys /grant=everyone=F
But, I do not want to have to always install or have subinacl or regini, mainly for legal reasons. Any included windows utilities are ok to use as long has WIndows XP Home has it already installed.
Avatar of bcdudley
bcdudley
Flag of United States of America image

Avatar of advcom
advcom

ASKER

I checked that out, but have yet to get it to work. I have read many other posts on forums with lots of people saying that they cannot get this to work either. Here is what I did. I created a text file named cmd.txt in the root directory. I put this in it:
\Registry\Machine\SYSTEM\CurrentControlSet\Services\test [7]
Then I created a subkey under HKLM\System\CurrentControlSet\Services\test
I verified that it did not have the everyone group already added.
Then I ran this command from cmd:
regini c:\cmd.txt
I do not get an error. But if I goto the reg key in regedit, the everyone group has not been added.
Not sure what I am doing wrong. Any suggestions?
Avatar of Chris Raisin
What should be showing in the key after you grant World Full Access?
Your text file would need this:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\test [7]

Open in new window


Then call:

 regini.exe "path\to\textfile.txt"

Hope this helps,
Daz.
Daz,

That is what advcom has already tried out.

If I find out what is needed in the key I have the answer for the author. The use of regini is not wanted, from what I gather.
ASKER CERTIFIED SOLUTION
Avatar of Darren Collins
Darren Collins
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of advcom

ASKER

All the info I found on regini showed the other format, but what you posted worked and it worked on XP Home. I just wanted something that would work on xp and not have to install anything. I just need to add the everyone group so that unreadable values are now readable.
Great, I'm glad that worked for you (and thanks for the grade).  But please remember that the regini functionality is to replace the permissions not add.  So after your test example above, all the other permissions will have gone, and only the Everyone / Full permission will be on that test key.

Thanks again,
Daz.