icacls C:\Users\%username%\AppData\Local\Mozilla\updates /q /c /t /deny users:F

1.8k Views Asked by At

I want to deny permission to mentioned folder for current user to access,modify,read. Using icacls. icacls C:\Users\%username%\AppData\Local\Mozilla\updates /q /c /t /deny users:F But i am getting error "The system cannot find the path specified"

Can anyone help me in this regards.

1

There are 1 best solutions below

14
AudioBubble On

Since you didn't provide much information, so my answer will be a guess.

"The system cannot find the path specified"

It obviously means the path does not exist. However, there is one exception: paths with space. To let cmd and batch file properly handle space, you will need to "quote" them. And, as @Mofi mentioned that it could be that the user's profile directory is not C:\Users\%USERNAME%

So my best guess to fix both problems, you should change the command to:

icacls "C:\Users\%Username%\AppData\Local\Mozilla\updates" /q /c /t /deny users:F

or this better solution suggest by @Mofi:

icacls "%LOCALAPPDATA%\Mozilla\updates" /q /c /t /deny users:F