Modify registry permissions with VBScript

Hello. I'm trying to create a VBScript that modifies permissions on two keys:

HKEY_LOCAL_MACHINE\Software\Microsoft\Shared Tools\Proofing Tools\Spelling
HKEY_LOCAL_MACHINE\Software\Microsoft\Shared Tools\Proofing Tools\Grammar

I need local users group to have full access to both keys and subkeys OR even just "everyone" group. The problem is that the script has to be run remotely, so it has to call a command prompt and switch to the SYSTEM32 folder before running the command? I'm not really familiar with Scripts so I may be thinking about this the wrong way. Any help would be greatly appreciated.
jmchristyAsked:
Who is Participating?
 
johnb6767Connect With a Mentor Commented:
Or psexec can do this in simple batch..... Nanme the following code below as GrantPerm.bat

DL PSEXEC, and pop it in the system32 directory of your machine (logged on as a user with rights to the targets)

Save a text file with all PCNames as c:\PCNames.txt

psexec @C:\PCNames.txt -d -c GrantPerm.reg


@echo off
copy "\\server\share\subinacl.exe" "c:\windows\system32\"
subinacl /subkeyreg "HKEY_LOCAL_MACHINE\Software\Microsoft\Shared Tools\Proofing Tools\Spelling
" /grant=Domain\Users
subinacl /subkeyreg "HKEY_LOCAL_MACHINE\Software\Microsoft\Shared Tools\Proofing Tools\Spelling
" /grant=Domain\Users
exit

Open in new window

0
 
johnb6767Commented:
Need to be VBS?

The following can be added to a Machine Startup Script..... Just need to put te subinacl on a network share and include a copy command to bring it locally.....

Download details: SubInACL (SubInACL.exe)
http://www.microsoft.com/downloads/details.aspx?FamilyID=E8BA3E56-D8FE-4A91-93CF-ED6985E3927B

subinacl /subkeyreg "HKEY_LOCAL_MACHINE\Software\Microsoft\Shared Tools\Proofing Tools\Spelling
" /grant=Domain\Users
subinacl /subkeyreg "HKEY_LOCAL_MACHINE\Software\Microsoft\Shared Tools\Proofing Tools\Spelling
" /grant=Domain\Users
0
 
rlandquistCommented:
0
[Webinar] Kill tickets & tabs using PowerShell

Are you tired of cycling through the same browser tabs everyday to close the same repetitive tickets? In this webinar JumpCloud will show how you can leverage RESTful APIs to build your own PowerShell modules to kill tickets & tabs using the PowerShell command Invoke-RestMethod.

 
jmchristyAuthor Commented:
John,

  After I have the GrantPerm.bat file created, do I have to rename it to GrantPerm.reg and run the command you listed "psexec @c:\PCNames.txt -d -c GrantPerm.reg"? In the PCNames.txt I can just list the computer names and that is all? Thanks
   
0
 
jmchristyAuthor Commented:
John,

  I tried running the psexec command with the GrantPerm.bat and received the following error "The specified application is not on the path".
0
 
jmchristyAuthor Commented:
UPDATE-

John,

Okay, I've got it copying the subinacl to the system32 folder, however when I run it I receive the following errors on the two registry keys. Not sure if I have something wrong wih the syntax or not? I've included the error message on this post.
error.png
0
 
jmchristyAuthor Commented:
UPDATE-

It's working. I had to make a few minor changes to John's syntax. I have a .BAT that I converted to an EXE that uses PSEXEC to call the GrantPerm.bat from my Sharepoint site on a per user basis. Thanks again.


@echo off 
copy "\\servername\share\subinacl.exe" "c:\windows\system32\" 
subinacl /subkeyreg "HKEY_LOCAL_MACHINE\Software\Microsoft\Shared Tools\Proofing Tools\Spelling" /grant=everyone=F 
subinacl /subkeyreg "HKEY_LOCAL_MACHINE\Software\Microsoft\Shared Tools\Proofing Tools\Grammar" /grant=everyone=F 
exit

Open in new window

0
 
johnb6767Commented:
Good catch on the group name....

Glad it is working....
0
All Courses

From novice to tech pro — start learning today.