Need help resetting folder permissions

TheThemePark

Banned
Local time
8:07 AM
Messages
9
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 Computer

OS
Windows 7 Professional 64 bit.
Reinstall Windows or restore an image. Since you didn't save the Security Descriptors there is no way to go back.
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Alienware Aurora ALX R4
OS
Windows 10 Pro (x64)
CPU
Intel Core i7-3930K (3.2GHz - 4.5GHz)
Motherboard
Alienware Aurora-R4 x79
Memory
4x Samsung 4GB PC3-12800 DDR3 (16GB 1600MHz)
Graphics Card(s)
Nvidia Geforce GTX 690
Sound Card
SteelSeries Siberia Elite
Monitor(s) Displays
Dell UltraSharp U3011
Screen Resolution
2560x1600
Hard Drives
Samsung 850 Pro 256 GB, Seagate 1TB Desktop Hybrid HDD, 2x Western Digital 4TB Green HDD
PSU
875W Some Dell PSU <.<
Case
Alienware Aurora ALX
Cooling
Custom Liquid Cooling (EK CPU & GPU blocks) dual EK 480RAD
Keyboard
Logitech G710+ Mechanical
Mouse
Logitech G700s
Internet Speed
Verizon Fios (50 mbps average)
Other Info
Server: Intel NUC D54250WYK: i5-4250U, 16GB, 256 GB mSATA, Windows Server 2012 R2

My Computer

Computer Manufacturer/Model Number
Asus G73SW-XN2
OS
Windows 2000 5.0 Build 2195
CPU
Intel Core i7-2630QM@2GHz(2.9GHz Turbo Boost) [Sandy Bridge]
Motherboard
Asus G73SW (Intel HM65 Chipset)
Memory
Kingston DDR3 1333 16GB (4GBx4)
Graphics Card(s)
nVidia GTX 460m 1.5GB
Sound Card
EAX Advanced HD 5.0, THX TruStudio
Monitor(s) Displays
17.3 in. primary & 23 in. secondary
Screen Resolution
1920x1080
Hard Drives
Seagate Momentus XT (SATA II) 500 GB @ 7200 RPM
Hitachi (SATA II) 500GB @ 7200 RPM

Non Raid because ASUS was crappy to choose an HM65 Chipset
Keyboard
Built-in 102-Key Backlit Keyboard
Other Info
It's a Laptop.
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 Computer

OS
Windows 7 Professional 64 bit.
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 Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Alienware Aurora ALX R4
OS
Windows 10 Pro (x64)
CPU
Intel Core i7-3930K (3.2GHz - 4.5GHz)
Motherboard
Alienware Aurora-R4 x79
Memory
4x Samsung 4GB PC3-12800 DDR3 (16GB 1600MHz)
Graphics Card(s)
Nvidia Geforce GTX 690
Sound Card
SteelSeries Siberia Elite
Monitor(s) Displays
Dell UltraSharp U3011
Screen Resolution
2560x1600
Hard Drives
Samsung 850 Pro 256 GB, Seagate 1TB Desktop Hybrid HDD, 2x Western Digital 4TB Green HDD
PSU
875W Some Dell PSU <.<
Case
Alienware Aurora ALX
Cooling
Custom Liquid Cooling (EK CPU & GPU blocks) dual EK 480RAD
Keyboard
Logitech G710+ Mechanical
Mouse
Logitech G700s
Internet Speed
Verizon Fios (50 mbps average)
Other Info
Server: Intel NUC D54250WYK: i5-4250U, 16GB, 256 GB mSATA, Windows Server 2012 R2
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:
/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.
/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
/U Copies only files that already exist in destination.
 

My Computer

Computer Manufacturer/Model Number
Asus G73SW-XN2
OS
Windows 2000 5.0 Build 2195
CPU
Intel Core i7-2630QM@2GHz(2.9GHz Turbo Boost) [Sandy Bridge]
Motherboard
Asus G73SW (Intel HM65 Chipset)
Memory
Kingston DDR3 1333 16GB (4GBx4)
Graphics Card(s)
nVidia GTX 460m 1.5GB
Sound Card
EAX Advanced HD 5.0, THX TruStudio
Monitor(s) Displays
17.3 in. primary & 23 in. secondary
Screen Resolution
1920x1080
Hard Drives
Seagate Momentus XT (SATA II) 500 GB @ 7200 RPM
Hitachi (SATA II) 500GB @ 7200 RPM

Non Raid because ASUS was crappy to choose an HM65 Chipset
Keyboard
Built-in 102-Key Backlit Keyboard
Other Info
It's a Laptop.
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
 
Last edited:

My Computer

OS
Windows 7 Professional 64 bit.
Back
Top