Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Need help resetting folder permissions

02 Jul 2011   #1
TheThemePark

Windows 7 Professional 64 bit.
 
 
Need help resetting folder permissions

I have been messing around with folder permissions on a Windows partition, and now I'd like to revert them back to how they were when Windows got installed. I know about icacls, and that it comes with a reset option, but that option doesn't actually reset it to default, it just uses the permissions at the path you're calling icacls from, and then replacing all permissions from there with those permissions.

But when Windows gets installed, there's a myriad of different permission settings for different folders, and that's what I want to revert it back to. For example, the Windows folder doesn't inherit its permissions from the root, and each user has their own unique permissions.

It would be too much work to do it manually, so is there a way I can use icacls for this, and actually get it to reset to the real default?


My System SpecsSystem Spec
.

02 Jul 2011   #2
logicearth

Windows 8.1 Pro (x64)
 
 

Reinstall Windows or restore an image. Since you didn't save the Security Descriptors there is no way to go back.
My System SpecsSystem Spec
02 Jul 2011   #3
arkhi

Windows 2000 5.0 Build 2195
 
 

Specifically:

Repair Install

EDIT:
BTW, out of curiosity, what folders did you change? It could be possible to copy the security descriptor from a parent folder if only a child folder was affected.
My System SpecsSystem Spec
.


02 Jul 2011   #4
TheThemePark

Windows 7 Professional 64 bit.
 
 

Well, reinstalling is certainly an option. But since installation and reinstallation can set the Security Descriptors on all the folders that are created, those descriptors must be hidden somewhere in Windows, presumably in a file somewhere. I was hoping to find that file.

arkhi, I changed the root folder and every subfolder and file. Even if I hadn't, I couldn't restore it 100 %, since like I said not all folders inherit permissions from the parent folder.

So let's say I get all the permissions restored completely to how they are when Windows is installed the first time. Can I then save them all for the entire drive, and then apply them to another drive, skipping the folders that do not exist on the new drive?
My System SpecsSystem Spec
02 Jul 2011   #5
logicearth

Windows 8.1 Pro (x64)
 
 

Security Descriptors are stored with the files not in some central repository.
icacls has an example just for backing up and restoring:
Code:
icacls c:\windows\* /save AclFile /T
- Will save the ACLs for all files under c:\windows
  and its subdirectories to AclFile.

icacls c:\windows\ /restore AclFile
- Will restore the Acls for every file within
  AclFile that exists in c:\windows and its subdirectories.
My System SpecsSystem Spec
02 Jul 2011   #6
arkhi

Windows 2000 5.0 Build 2195
 
 

Quote   Quote: Originally Posted by TheThemePark View Post
So let's say I get all the permissions restored completely to how they are when Windows is installed the first time. Can I then save them all for the entire drive, and then apply them to another drive, skipping the folders that do not exist on the new drive?
Not sure about saving, but you can definitely try logicearth's command line.

As for me, I did

Code:
 
XCOPY source [destination] [/X]
Where:
Quote:
/O Copies file ownership and ACL information.
/X Copies file audit settings (implies /O).
You can also experiment with other switches to suit your needs, i.e.
Quote:
/S Copies directories and subdirectories except empty ones.
/E Copies directories and subdirectories, including empty ones.
Same as /S /E. May be used to modify /T.
/H Copies hidden and system files also.
/R Overwrites read-only files.
...and for skipping folders that do not exist
Quote:
/U Copies only files that already exist in destination.
My System SpecsSystem Spec
06 Jul 2011   #7
TheThemePark

Windows 7 Professional 64 bit.
 
 

Okay, so neither xcopy nor icacls seem to actually set the permissions. I tried using robocopy to only copy the ACLs, but for some reason it skips all the directories, even though they're the same, and it copies none of them. I'm using robocopy "d:\Program Files" "c:\Program Files" *.* /r:0 /copy:sou /v /e
My System SpecsSystem Spec
Reply

 Need help resetting folder permissions




Thread Tools





Similar help and support threads
Thread Forum
folder settings randomly resetting
I have no idea why but I for some reason the settings I apply to specific folders have been getting reset at seemingly random times. By folder settings I mean sorting options mostly. I have to frequently re-select my pictures folder to have the option to sort by 'date created' and then select...
General Discussion
Folder permissions
New to the forum, so I would just like to say hi to everyone. :D I have a problem with subfolder permissions. I have a 2nd partition on my W7 HDD with various data, most of the folders I do not have permission to access. Taking ownership of folders wasn't a problem, but the majority of...
General Discussion
Folder Permissions
I took a folder - right click>properties>security> took away administrator privileges, but left my user (an administrator) still have rights. Now I can't access the folder. When I go back to the security tab it says you do not have permission to change this folder. It is a locked folder now?
General Discussion
Problem with Windows 7 -64 resetting folder and icons
Hello, here a very strange problem that happen JUST with ONE user. All the other users, administrator included, do not have this problem. So I think it is not a system wide problem, just one user (ME, sadly) problem. I pretty much tryed a lot of stuff to try to fix this problem, without...
Customization
folder permissions
Hi, I'm not sure that this is the right discussion but if it isn't please tell me. I just got my new laptop with windows 7 home premium installed and I'm having a tough time accessing certain folders and features. I set up my login name with administrative permissions but I still cant...
System Security
Help with folder permissions!
Can someone help me with my folder permissions in Windows 7? I tried changed folder permissions in C:\Users and it messed stuff up bad. Whenever I go into Firefox it says "Could not initialize security component..." and my Catalyst Control Center won't boot up properly. This is after doing a...
General Discussion

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 01:48.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App