SEARCH

The How-To Geek Forums Have Migrated to Discourse

How-To Geek Forums / Tutorials

Tutorial: Setting permissions on a Registry key

(10 posts)
  • Started 3 years ago by Veegertx
  • Latest reply from LH
  • Topic Viewed 16173 times

Veegertx
Veegertx
Posts: 376

We have all seen the tweaks to registry for Vista and Windows 7 on several sites that in order for them to work we must set permissions on a Registry key. That is because the only Sid that has Full permissions is Trusted Installer
Example http://www.askvg.com/how-to-cu.....-explorer/
First before tampering with your registry make sure you back it up.
I use Mz Registry Backup 2.0 http://www.mztweak.com/mzregistrybackup.html
I am on 64 bit Se7en and this worked. It's your system so don't blame me.

Next we need an external small program setacl.exe
Homepage: http://setacl.sourceforge.net
Version: 2.1.2.0
Copyright: Helge Klein
License: GPL

Extract and use the SetACL 2.1.2\Command line version\x64 or Command line version\x86 whichever for your system.
Now what I will show here is how to set permissions on these 2 keys and then delete them
HKEY_CLASSES_ROOT\DesktopBackground\Shell\Display
HKEY_CLASSES_ROOT\DesktopBackground\Shell\Gadgets

Those are the right click on Desktop that you see 'Screen Resolution' and 'Gadgets'. I want to remove them cause I have added things I use daily like Add/Remove or Command prompt. Now once I set my screen resolution I won't be changing daily so I want to eliminate. I also don't use Gadgets cause I have a desktop wallpaper that changes and I'd rather see that if I am ever on the desktop which is rare :)

I am not sure if all this is needed but it works. I also have tried to get the recurse to work but haven't as of this exact minute but I never surrender
I create a setacl.cmd in same folder as my architecture x64.

Get everything in the code box
Replace Administrators with your language word for this. Like French is Administrateurs

setacl.cmd
REM ----------------------------------------------------------------
cd /d %~dp0
@ECHO OFF
Title Replacing permissions on HKEY_CLASSES_ROOT\DesktopBackground\Shell\Display

setacl.exe -on "hkcr\DesktopBackground\Shell\Display" -ot reg -actn setowner -ownr "n:Administrators"
setacl.exe -on "hkcr\DesktopBackground\Shell\Display" -ot reg -actn ace -ace "n:Administrators;p:full"
setacl.exe -on "hkcr\DesktopBackground\Shell\Display\command" -ot reg -actn setowner -ownr "n:Administrators"
setacl.exe -on "hkcr\DesktopBackground\Shell\Display\command" -ot reg -actn ace -ace "n:Administrators;p:full"

setacl.exe -on "hkcr\DesktopBackground\Shell\Gadgets" -ot reg -actn setowner -ownr "n:Administrators"
setacl.exe -on "hkcr\DesktopBackground\Shell\Gadgets" -ot reg -actn ace -ace "n:Administrators;p:full"
setacl.exe -on "hkcr\DesktopBackground\Shell\Gadgets\command" -ot reg -actn setowner -ownr "n:Administrators"
setacl.exe -on "hkcr\DesktopBackground\Shell\Gadgets\command" -ot reg -actn ace -ace "n:Administrators;p:full"
Pause
REG DELETE hkcr\DesktopBackground\Shell\Display /f
REG DELETE hkcr\DesktopBackground\Shell\Gadgets /f
Pause
Exit
REM ----------------------------------------------------------------

I add the Pause to see if it's successful
SetACL finished successfully.
INFO: Processing ACL of: <classes_root\DesktopBackground\Shell\Display>
SetACL finished successfully.
INFO: Processing ACL of: <classes_root\DesktopBackground\Shell\Gadgets>
and then the delete
The operation completed successfully.

Thats it. Right click your desktop and they are gone
This will work for registry keys also but you will have to change as needed.

Posted 3 years ago
Top
 
Veegertx
Veegertx
Posts: 376

I can't edit my above so add this at top of .cmd right before first setacl.exe -on and it will export them 2 keys prior to removing so you have a backup :)
REG EXPORT hkcr\DesktopBackground\Shell\Display Display.reg
REG EXPORT hkcr\DesktopBackground\Shell\Gadgets Gadgets.reg
pause

Posted 3 years ago
Top
 
Veegertx
Veegertx
Posts: 376

On above change hkcr to HKCR instead

OK next part since I have learned to recurse which will come within one of the following. I also have figured out we don't need the 2 commands except in above and 1 other item

Remove “Favorites” from Windows 7 Explorer’s Navigation Pane

cd /d %~dp0
@ECHO OFF
Title Remove “Favorites” from Windows 7 Explorer’s Navigation Pane
ECHO http://www.askvg.com/how-to-re.....tion-pane/

ECHO Y| REG EXPORT HKEY_CLASSES_ROOT\CLSID\{323CA680-C24D-4099-B94D-446DD2D7249E}\ShellFolder Favorites.reg
ECHO.
pause

setacl.exe -on "HKCR\CLSID\{323CA680-C24D-4099-B94D-446DD2D7249E}\ShellFolder" -ot reg -actn ace -ace "n:Administrators;p:full"

Pause
ECHO NOTE: If you want to restore "Favorites" in Navigation pane, simply change value of "Attributes" DWORD to 2693792000
REG ADD "HKCR\CLSID\{323CA680-C24D-4099-B94D-446DD2D7249E}\ShellFolder" /v "Attributes" /t REG_DWORD /d "2839544064" /f

Pause
Exit

Posted 3 years ago
Top
 
thegeek
The Geek
Posts: 2059

Thanks for this... I'm going to turn this into an article, will make sure to give you credit.

Posted 3 years ago
Top
 
Veegertx
Veegertx
Posts: 376

No problem The Geek, I share what I figure out.
Mainly I don't like doing all that stuff manually when I can accomplish it with code or .cmd
Just don't look right with code brackets

Remove “Homegroup” from Windows 7 Explorer’s Navigation Pane
I have no use for this, yes there is a 2nd pc here but she stay's out of mine and and I do the same :)

cd /d %~dp0
@ECHO OFF
Title Remove “Homegroup” from Windows 7 Explorer’s Navigation Pane
ECHO http://www.askvg.com/how-to-re.....tion-pane/

ECHO Y| REG EXPORT HKEY_CLASSES_ROOT\CLSID\{B4FB3F98-C1EA-428d-A78A-D1F5659CBA93}\ShellFolder Homegroup.reg
ECHO.
pause

setacl.exe -on "HKCR\CLSID\{B4FB3F98-C1EA-428d-A78A-D1F5659CBA93}\ShellFolder" -ot reg -actn ace -ace "n:Administrators;p:full"

Pause
ECHO NOTE: If you want to restore "Homegroup" in Navigation pane, simply change value of "Attributes" DWORD to 2961441036
REG ADD "HKCR\CLSID\{B4FB3F98-C1EA-428d-A78A-D1F5659CBA93}\ShellFolder" /v "Attributes" /t REG_DWORD /d "2962489612" /f

Pause
Exit

Posted 3 years ago
Top
 
Veegertx
Veegertx
Posts: 376

Remove “Libraries” from Windows 7 Explorer’s Navigation Pane

cd /d %~dp0
@ECHO OFF
Title Remove “Libraries” from Windows 7 Explorer’s Navigation Pane
ECHO http://www.askvg.com/how-to-re.....tion-pane/

ECHO Y| REG EXPORT HKEY_CLASSES_ROOT\CLSID\{031E4825-7B94-4dc3-B131-E946B44C8DD5}\ShellFolder Libraries.reg
ECHO.
pause

setacl.exe -on "HKCR\CLSID\{031E4825-7B94-4dc3-B131-E946B44C8DD5}\ShellFolder" -ot reg -actn ace -ace "n:Administrators;p:full"

Pause
ECHO NOTE: If you want to restore "Libraries" in Navigation pane, simply change value of "Attributes" DWORD to 2961178893
REG ADD "HKCR\CLSID\{031E4825-7B94-4dc3-B131-E946B44C8DD5}\ShellFolder" /v "Attributes" /t REG_DWORD /d "2962227469" /f

Pause
Exit

Posted 3 years ago
Top
 
Veegertx
Veegertx
Posts: 376

Remove “Network” from Windows 7 Explorer’s Navigation Pane

cd /d %~dp0
@ECHO OFF
Title Remove “Network” from Windows 7 Explorer’s Navigation Pane
ECHO http://www.askvg.com/how-to-re.....tion-pane/

ECHO Y| REG EXPORT HKEY_CLASSES_ROOT\CLSID\{F02C1A0D-BE21-4350-88B0-7367FC96EF3C}\ShellFolder Network.reg
ECHO.
pause

setacl.exe -on "HKCR\CLSID\{F02C1A0D-BE21-4350-88B0-7367FC96EF3C}\ShellFolder" -ot reg -actn ace -ace "n:Administrators;p:full"

Pause
ECHO NOTE: If you want to restore "Libraries" in Navigation pane, simply change value of "Attributes" DWORD to 2953052260
REG ADD "HKCR\CLSID\{F02C1A0D-BE21-4350-88B0-7367FC96EF3C}\ShellFolder" /v "Attributes" /t REG_DWORD /d "2962489444" /f

Pause
Exit

Posted 3 years ago
Top
 
Veegertx
Veegertx
Posts: 376

Anyone need help with any of these or see a better way then let me know.

and 1 more. Remember in first one we done 2 setacl commands for each reg. I went back and tried with just 1 but didn't work. When I say went back Mz Registry Backup did not restore permissions so I imaged back. This one requires using both also. I also recurse on this -rec but not sure it needed but it won't hurt just adding Administrators to permissions.
Edit: If you copy from the code box it will place it correctly in a .cmd file. start at cd /d %~dp0

Customize Windows Explorer Command Bar (aka Folder Band or Toolbar) in Windows Vista and 7

cd /d %~dp0
@ECHO OFF
Title Customize Windows Explorer Command Bar (aka Folder Band or Toolbar) in Windows Vista and 7
ECHO http://www.askvg.com/how-to-cu.....l-buttons/

ECHO Y| REG EXPORT HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderTypes\{5c4f28b5-f869-4e84-8e60-f11db97c5cc7} CommandBar.reg
Pause
setacl.exe -on "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderTypes\{5c4f28b5-f869-4e84-8e60-f11db97c5cc7}" -ot reg -actn setowner -ownr "n:Administrators"
setacl.exe -on "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderTypes\{5c4f28b5-f869-4e84-8e60-f11db97c5cc7}" -ot reg -actn ace -ace "n:Administrators;p:full" -rec yes

Pause
ECHO NOTE: If you want to restore Command Bar to Default then delete these 2 keys TasksItemsSelected and TasksNoItemsSelected
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderTypes\{5c4f28b5-f869-4e84-8e60-f11db97c5cc7}\TasksItemsSelected" /v "" /t REG_SZ /d "Windows.Cut; Windows.Copy; Windows.Delete; Windows.rename; Windows.properties; Windows.closewindow" /f
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderTypes\{5c4f28b5-f869-4e84-8e60-f11db97c5cc7}\TasksNoItemsSelected" /v "" /t REG_SZ /d "Windows.selectall; Windows.Paste; Windows.undo; Windows.redo; Windows.menubar; Windows.previewpane; Windows.readingpane; Windows.navpane; Windows.closewindow" /f

Pause
Exit

Posted 3 years ago
Top
 
cnknsd
Posts: 1

Anyone know about changing windows 7 x64 registry permissions from 32bit with SetACL?

I need to change "USERS" permissions on a registry key HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update to full permissions. I am using the following command for that...

setacl.exe -on "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update" -ot reg -actn ace -ace "n:Users;p:full"

However this does not change the permissions on the reg key.

Also tried adding Everyone with full access, not sure how to accomplish this, though this would be the best option, to add everyone with full permissions to that registry key.

Does anyone have any ideas? right from the command line would be great...

Kel

Posted 3 years ago
Top
 
LH
LH
Posts: 20002

cnknsd hi. Please post your question in a New Topic.

Posted 3 years ago
Top
 



Topic Closed

This topic has been closed to new replies.

Enter Your Email Here to Get Access for Free:

Go check your email!