1

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

e.g.

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?

1
  • 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
    Commented Oct 30, 2019 at 14:30

1 Answer 1

1

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
4
  • Thanks for the quick answer! I think the command should be junction -d -s S:\folder. Can you confirm?
    – huha
    Commented Oct 30, 2019 at 15:01
  • Confirmed and fixed.
    – harrymc
    Commented Oct 30, 2019 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
    Commented Oct 30, 2019 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
    Commented Oct 30, 2019 at 15:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .