Resetting permissions of folders

crockhamtown

Member
Joined
Jul 17, 2023
Messages
8
Reaction score
1
I downloaded QB64 (for BASIC programming) and put it my Documents folder before installing it in the Programs folder. The Readme suggested I take "write" control of it's main folder using right click/properties/security/permissions. I opted for full control thinking that it would be better. I now find that it has affected all other folders within Documents. I'm not now sure whether this is a good or bad move. I've tried resetting using a restore point but that didn't change the "full control". Other Windows forum suggested solutions that look very complicated which frightens me.
1. Is it risky if I just carry on?
2. Is there a windows tool that will do it for me?
 

Xploit Machine

Well-known member
Joined
Nov 29, 2022
Messages
1,088
Reaction score
96
For taking ownership of a specific folder and its subfolders use the code below (then save as TakeOwnership.reg) .. restart the computer;

Windows Registry Editor Version 5.00

; Joe Isabella @ Xploit Machine
; 01 December 2022
; (e-mail address removed)

[-HKEY_CLASSES_ROOT\*\shell\TakeOwnership]
[-HKEY_CLASSES_ROOT\*\shell\runas]

[HKEY_CLASSES_ROOT\*\shell\TakeOwnership]
@="Take Ownership"
"Extended"=-
"HasLUAShield"=""
"NoWorkingDirectory"=""
"NeverDefault"=""

[HKEY_CLASSES_ROOT\*\shell\TakeOwnership\command]
@="powershell -windowstyle hidden -command \"Start-Process cmd -ArgumentList '/c takeown /f \\\"%1\\\" && icacls \\\"%1\\\" /grant *S-1-3-4:F /t /c /l' -Verb runAs\""
"IsolatedCommand"= "powershell -windowstyle hidden -command \"Start-Process cmd -ArgumentList '/c takeown /f \\\"%1\\\" && icacls \\\"%1\\\" /grant *S-1-3-4:F /t /c /l' -Verb runAs\""

[HKEY_CLASSES_ROOT\Directory\shell\TakeOwnership]
@="Take Ownership"
"AppliesTo"="NOT (System.ItemPathDisplay:=\"C:\\Users\" OR System.ItemPathDisplay:=\"C:\\ProgramData\" OR System.ItemPathDisplay:=\"C:\\Windows\" OR System.ItemPathDisplay:=\"C:\\Windows\\System32\" OR System.ItemPathDisplay:=\"C:\\Program Files\" OR System.ItemPathDisplay:=\"C:\\Program Files (x86)\")"
"Extended"=-
"HasLUAShield"=""
"NoWorkingDirectory"=""
"Position"="middle"

[HKEY_CLASSES_ROOT\Directory\shell\TakeOwnership\command]
@="powershell -windowstyle hidden -command \"Start-Process cmd -ArgumentList '/c takeown /f \\\"%1\\\" /r /d y && icacls \\\"%1\\\" /grant *S-1-3-4:F /t /c /l /q' -Verb runAs\""
"IsolatedCommand"="powershell -windowstyle hidden -command \"Start-Process cmd -ArgumentList '/c takeown /f \\\"%1\\\" /r /d y && icacls \\\"%1\\\" /grant *S-1-3-4:F /t /c /l /q' -Verb runAs\""

[HKEY_CLASSES_ROOT\Drive\shell\runas]
@="Take Ownership"
"Extended"=-
"HasLUAShield"=""
"NoWorkingDirectory"=""
"Position"="middle"
"AppliesTo"="NOT (System.ItemPathDisplay:=\"C:\\\")"

[HKEY_CLASSES_ROOT\Drive\shell\runas\command]
@="cmd.exe /c takeown /f \"%1\\\" /r /d y && icacls \"%1\\\" /grant *S-1-3-4:F /t /c"
"IsolatedCommand"="cmd.exe /c takeown /f \"%1\\\" /r /d y && icacls \"%1\\\" /grant *S-1-3-4:F /t /c"
 

Vote:

Xploit Machine

Well-known member
Joined
Nov 29, 2022
Messages
1,088
Reaction score
96
For taking reverting original ownership to default of a specific folder and its subfolders use the built-in Reset Permission command / method .. restart the computer;

Please post if you any further enquiries :)

Untitled.jpg
 

Vote:

Xploit Machine

Well-known member
Joined
Nov 29, 2022
Messages
1,088
Reaction score
96
actually keeping the "Take Ownership" permissions doesn't affect unless the user took full control of System32 and SysWow64 folder in the Windows folder makes it vulnerable though ..
 

Vote:

RogerOver

Well-known member
Joined
Jun 14, 2022
Messages
401
Reaction score
55
Hi crockhamtown,
an easy way is to use Tweaking.com WindowsRepair_All in one

Open the downloaded freeware, click on "Go to repair" or similar (my computer is in French); see red encerceld in screenshot n° 1.

A new window will open, click again on "Go to repair" (or similar).

There will be a warning that you should go to Save mode: accept to not go to save mode.
Windows Repair will automatically create a Registry Backup.

Then only click point 2 ("Reset folder permissions"), remove all other ticks; see screenshot n° 2

Run "Begin repair" and restart after the software has finished to run.

Thats's it !

Capture1a.PNGCapture2.PNG
 
Last edited:

Vote:

crockhamtown

Member
Joined
Jul 17, 2023
Messages
8
Reaction score
1
Hi RogerOver. I've downloaded your tool and set it running as per your suggestion. I immediately got the message in the attached image. Nevertheless I kept it going and has been running for getting on for an hour. Do you think it is still actively doing repairs or should I abandon it? NB I did select option 2
 

Attachments

  • 20230718_120652.jpg
    20230718_120652.jpg
    262.4 KB · Views: 5

Vote:

RogerOver

Well-known member
Joined
Jun 14, 2022
Messages
401
Reaction score
55
Hi crockhamtown,

Strange ! I have no direct explanation. This is not normal.
I know this tool since many years.

As it says that "You must chose at least one option" and "Repair stopped by user", ther is a chance somethng went wrong when clikced the option 2. I'd propose to close the application and run it again (possibly also in safe mode this time) !

It could also be that there are other problems on your computer. To be one safe side, run "sfc /scannow" first.
To do so, type "cmd" in the search box of your computer.
Rightlick on the cmd tool (black icon), chose "run ad administrator" and type: "sfc /scannow" (without quotes) at the cmd prompt. (There is a space between sfc and the slash).

When finished you will get a message saying either that sfc has found problems and repaired them, or that it did not find any problems.

In both cases, then try "Windows repair" again.
 
Last edited:

Vote:

crockhamtown

Member
Joined
Jul 17, 2023
Messages
8
Reaction score
1
Sorry RogerOver I ran scannow confirmed that my drive is okay. Ran the tool again in safe mode but the same problem arose.

I've now downloaded Macrium Reflect Server Plus and installed it. But Xploit Machine, I cannot find the paths in the image you posted. I have got as far as the attached image.
 

Attachments

  • Macrium.png
    Macrium.png
    602.4 KB · Views: 1

Vote:

Xploit Machine

Well-known member
Joined
Nov 29, 2022
Messages
1,088
Reaction score
96
LOL, no .. the Macrium Reflect is just sample folder which I have clicked to show you the RESET PERMISSIONS command, it is not necessary for you to install it ..

just right click any folders which you have taken ownership previously and you shall see RESET PERMISSIONS command :)
 

Vote:

crockhamtown

Member
Joined
Jul 17, 2023
Messages
8
Reaction score
1
Well I must be terribly thick about Windows 11. When I right click a folder I do not see the RESET PERMISSIONS command.

I must be missing something after Right click.

To show ignorant I am I cannot even find the emoji button on this forum to show a smiling face.
 

Vote:

Xploit Machine

Well-known member
Joined
Nov 29, 2022
Messages
1,088
Reaction score
96
Copy & use below code, save as Reset Permissions.reg and run it .. restart the computer and you shall have RESET PERMISSIONS command when you right-click a specific folder :)

Windows Registry Editor Version 5.00

; Joe Isabella @ Xploit Machine
; 01 December 2022
; (e-mail address removed)

[HKEY_CLASSES_ROOT\*\shell\ResetPermissions]
"MUIVerb"="Reset Permissions"
"HasLUAShield"=""
"NoWorkingDirectory"=""
"Position"="middle"
"Extended"=-

[HKEY_CLASSES_ROOT\*\shell\ResetPermissions\command]
@="powershell -windowstyle hidden -command \"Start-Process cmd -ArgumentList '/c icacls \\\"%1\\\" /reset' -Verb runAs\""

[HKEY_CLASSES_ROOT\Directory\shell\ResetPermissions]
"MUIVerb"="Reset Permissions"
"HasLUAShield"=""
"NoWorkingDirectory"=""
"Position"="middle"
"Extended"=-
"SubCommands"=""

[HKEY_CLASSES_ROOT\Directory\shell\ResetPermissions\shell\001flyout]
"MUIVerb"="Reset permissions of this folder only"
"HasLUAShield"=""

[HKEY_CLASSES_ROOT\Directory\shell\ResetPermissions\shell\001flyout\command]
@="powershell -windowstyle hidden -command \"Start-Process cmd -ArgumentList '/c icacls \\\"%1\\\" /reset' -Verb runAs\""

[HKEY_CLASSES_ROOT\Directory\shell\ResetPermissions\shell\002flyout]
"MUIVerb"="Reset permissions of this folder, subfolders and files"
"HasLUAShield"=""

[HKEY_CLASSES_ROOT\Directory\shell\ResetPermissions\shell\002flyout\command]
@="powershell -windowstyle hidden -command \"Start-Process cmd -ArgumentList '/c icacls \\\"%1\\\" /reset /t /c /l' -Verb runAs\""
 

Vote:

RogerOver

Well-known member
Joined
Jun 14, 2022
Messages
401
Reaction score
55
Copy & use below code, save as Reset Permissions.reg and run it ..
Very nice and certainly better than my solution !,,👍

But - as @crackhamtown said - I didn't get what you meant in your first replies either 🤔, ... otherwise I had not proposed my solution. Your's is much more straightforward ! (Even if still do not understand why the tool did not work for crackhamtown).
 
Last edited:

Vote:

Xploit Machine

Well-known member
Joined
Nov 29, 2022
Messages
1,088
Reaction score
96
Very nice and certainly better than my solution !,,👍

But - as @crackhamtown said - I didn't get what you meant in your first replies either 🤔, ... otherwise I had not proposed my solution. Your's is much more straightforward ! (Even if still do not understand why the tool did not work for crackhamtown).

Your appl tool is good and GUI mode, suitable for normal users .. probably TT didn't run as administrator and the tool process was stopped by system, while I use direct registry injection method whereby works most of the occasions ..

but not to worry, as the system tweak / modifications and reverting method all tested personally by myself and will not hard the system :)
 

Vote:

Xploit Machine

Well-known member
Joined
Nov 29, 2022
Messages
1,088
Reaction score
96
Refer this as I can't add more than 420 characters in PM / DM ..

Run this first and reboot computer -> Add Run As Administrator Context - Very important to make Run As Administrator any files, applications

Run all command below with Administrator rights (Run As Administrator after restart)
Add Compact OS Context Menu -
To compress system files, saves space wont affect system workaround
Add Component Store Clean Context Menu - To compress component files, saves space wont affect system workaround
Add Reset Permissions Context Menu - This was the file you need before in the thread
Administrators UAC Elevate Without Prompting - Very important to make Run As Administrator any files, applications
Classic Windows Explorer Style - Enables Windows 7 style Explorer commands and menu', easy guide for users
Disable All Advertisement & Tailored Experiences - Disables send to Microsoft data usages, useful for system performance
Take Ownership - This is to enable Take Ownership command menu, can revert by executing Reset Permissions later (usually let it Take Ownership be there)

Download all in this archive and run as above methods -
https://download.gg/file-15451460_28f22500cfb935dc
 
Last edited:

Vote:

crockhamtown

Member
Joined
Jul 17, 2023
Messages
8
Reaction score
1
Downloaded the archive, extracted it clicked on Add Reset Permissions, etc and it went straight to Registry. I now have it in the context menu and have reset the folders in question. Many thanks Xploit.(y)
 

Vote:

Xploit Machine

Well-known member
Joined
Nov 29, 2022
Messages
1,088
Reaction score
96
Downloaded the archive, extracted it clicked on Add Reset Permissions, etc and it went straight to Registry. I now have it in the context menu and have reset the folders in question. Many thanks Xploit.(y)

If you are the single user of the computer, may leave the those commands as it is, not necessary to remove it .. and use it with care when it comes to system related folders :)
 

Vote:

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top