Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is there some way to change the permissions recursively on a series of directories without getting a dialog box that pops up and tells me it can't change the permissions on a particular file?

I keep getting this dialogs multiple times duing the process of changing permissions:

An error occurred while applying security information to:

C:\pagefile.sys

The process cannot access the file because it is being used another process.

Eventually I get so many of them that I start clicking the mouse or pressing the space bar so many times that I accidentally click the cancel button.

Also it would be great if I could keep a log of which files it can't change permissions on.

Is this possible in Windows 7? Does it have to be done from the command prompt or from powershell?

share|improve this question
    
This is off topic for ServerFault, please check out our FAQ. It may on topic on SuperUser, but please check out their FAQ first. –  Dan Oct 3 '12 at 18:19
    
That said, please indicate what you're trying to achieve. I've never ever had to change permissions pagefile.sys and I sincerely doubt it's even possible. As the dialog says, the file is in use and never wont be while the machine is running. –  Dan Oct 3 '12 at 18:20
    
pagefile.sys was just an example, there are a bunch of temp files that have the same issue. The permissions on my machine are messed up due to a failed load of a roaming profile. The roaming profile really needs folder redirection, but it didn't have that when I got here and I wasn't really even aware we were using roaming profiles, so when this happened I was really caught off guard. –  leeand00 Oct 3 '12 at 18:31
    
I'm new here, but the senior IT guy told me to change my permissions on my entire hard drive, and that is why I am asking this question. –  leeand00 Oct 3 '12 at 18:32
1  
@leeand00 One of you has misunderstood - in my entire career, I've never had to change a whole drives permissions unless I'm doing something with a drive connected by USB. The best place to ask is probably SuperUser, but I really think ultimately the answer is "Don't do this." Go back to your IT guy and see what he's trying to achieve –  Dan Oct 3 '12 at 19:10
show 5 more comments

migrated from serverfault.com Oct 8 '12 at 5:39

This question came from our site for professional system and network administrators.

1 Answer

The problem you're running into is that you can't modify permissions on files in use by the operating system. The other problem you will run into with this approach is that you can't change permissions on files you don't have access to, or will get a UAC prompt on in order to access.

The "solution" here is to access the disk when it's not running an operating system. You do this by mounting the disk as a secondary drive, or booting into another environment that lets you access it without booting into it (Linux LiveCD, WinPXE, etc).

After that's done, you'll need to take ownership of all files, folders and subfolders on the disk before you'll be able to achieve what you want to achieve, allowing Full Control of all files, folders and subfolders on the disk.

As advised in the comments, you really should be telling us what you're actually trying to do, because I can think of almost no reasons why you'd need or want to universally change the permissions on every file and folder on a Windows system drive, and doing so will cause you issues down the line.

share|improve this answer
    
I wish I knew why...he was telling me to do this... –  leeand00 Oct 3 '12 at 20:14
    
@leeand00 Well, ask. I see two possibilities. Like I alluded to in the comments, he might be sending you on an IT snipe hunt. (Or testing you to see how much you know by how long it takes you to figure this task out.) Other possibility is that he's a moron and/or knows nothing about administering Windows. –  HopelessN00b Oct 3 '12 at 20:18
    
I asked him how to get my roaming profile up and running again. My roaming profile got too big...and it takes a really long time to log in. So I moved what I thought was my profile in some directory called \\server-name\users$\leeand00 but it wasn't there it was in \\server-name\profiles$\leeand00 the thing was 8GB it was taking forever to load. And I also moved it from my C:\Users\leeand00 directory as well. But that's when I found out from him that roaming profiles are stored on the server in \\server-name\profiles$ And that this was why I'm still waiting for my login. –  leeand00 Oct 3 '12 at 20:20
    
@leeand00 Well that changes things. The files you're trying to move are probably in use as a result of you being logged into your machine. Log in as a different user, and you should be able to move that folder tree. Incidentally, you should not be trying to move the whole hard drive... so you shouldn't be change the permissions on, or even involving the page file in this little move/permissions change of yours. –  HopelessN00b Oct 3 '12 at 20:29
1  
@leeand00 Right. That was totally not the correct way to move a user profile. As a result, your user profile is all kinds of messed up. Put it back, and then do a search on how to correctly move a user profile... and/or ask for clarification on the parameters of your task from the senior IT guy. –  HopelessN00b Oct 3 '12 at 20:37
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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