I saved my Win7 System paratition to an external drive. Then formatted and installed Win10 instead of Win7. Everything ok so far.

In order to get access to all the files on the saved folders I mounted this drive as S: Then started

icacls <folder> /reset /t /c /l


icacls s:\users /reset /t /c /l

for several folders on drive S: including s:\ProgramData, "s:\Program Files" and s:\Users. During the long lasting run of icacls with s:\Users I recognized that i could no longer start the system settings. I also couldn't use the search box. It didnt allow anything to enter. Win + R still worked.

I'm quite sure that this action also changed some access rights on drive C: (actual system). After doing a System Restore. Most things worked again as expected.

So please: What had happened? Why are permissions changed on drive c: although I used drive s:? Did it follow symlinks (I used /l to avoid this)?

And what can be done to change the permissions on a drive without changing any other drive?

  • For compatibility reasons, some folders contain junctions (or maybe symbolic links?) with legacy folder names that point at the new location of this content. This could be related. – Daniel B Oct 30 '19 at 14:30

The icacls documentation only says about the /l parameter this:

/l  Performs the operation on a symbolic link versus its destination.

However, in this post the poster said that it operates across junctions (symlinks) with or without this parameter. So this might be what happened to you.

To remove all junctions, you could use the Sysinternals utility Junction.

You could run as Admin the command:

junction -d -s S:\folder

But pay attention to error messages listing folders that were not accessible. In such a case you might need to also take ownership of the folders using takeown:

takeown /r /d Y S:\folder
  • Thanks for the quick answer! I think the command should be junction -d -s S:\folder. Can you confirm? – huha Oct 30 '19 at 15:01
  • Confirmed and fixed. – harrymc Oct 30 '19 at 15:10
  • What does junction -d -s do if it deletes a junction? Does it first delete the junction and so not follow it, or does it first follow it recursively and afterwards delete it? I need the 1st one in order not to delete anything on drive c: – huha Oct 30 '19 at 15:23
  • I never thought of the 2nd possibility, but I believe junction cannot work this way, or even the simple junction -d would become a cascade. – harrymc Oct 30 '19 at 15:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.