dboone Posted October 12, 2005 Share Posted October 12, 2005 (edited) I run a small computer repair shop. I often have to transfer data between hard drives due to a reformat or upgrade. During which I sometimes run into problems with file permissions that are set on directories or files from previous user accounts. I can sometimes override these setting by forcing new ownership through windows security settings however it doesn't always work right or doesn't change all the sub directories. I would love to find a way to automatically clear all previous permissions and force new ones. A batch files would be great but all I can find so far are ones that remove file attributes.Any Ideas from all you wonderful and knowledgeable people would be greatly appreciated. - I need something that will work with both XP Home and ProThx, Darin Edited October 12, 2005 by dboone Link to comment Share on other sites More sharing options...
Joc Posted October 12, 2005 Share Posted October 12, 2005 (edited) Hi,for this problem i use cacls.exe which displays or modifies access control lists (ACLs) of files.I think it is a part of some admin tools set...See this: http://www.ss64.com/nt/cacls.htmlJoc Edited October 12, 2005 by Joc Link to comment Share on other sites More sharing options...
DL. Posted October 12, 2005 Share Posted October 12, 2005 (edited) FOR %%i IN (*.*) DO cacls "%%i" /T /C /P "%USERNAME%":Forcacls *.* /T /C /P "%USERNAME%":Fxcacls *.* /T /C /Y /P "%USERNAME%":fCacls is included in WXP, Xcacls is part of some reskit and can be downloaded.Xcacls can use the /Y switch which makes it possible to replace rights without verifying (read more on the site Joc mentioned).I'm not sure, but it may be possible to use only the second command.It may also be possible to replace "%USERNAME%" with a group name (e.g. administrators) or *.*/everyone.I use cacls to give me full rights to the "System Volume Information"-folder in order to remove it (permanently). Edited October 12, 2005 by DL. Link to comment Share on other sites More sharing options...
Yzöwl Posted October 12, 2005 Share Posted October 12, 2005 Try adding the Y automatically tooECHO Y| CACLS "X:\Path" /T /C /G Administrators:FJust change the X:\Path to suit. Link to comment Share on other sites More sharing options...
oofki Posted October 12, 2005 Share Posted October 12, 2005 That or you can get subinacl.exe from microsoft and use this in a batch:subinacl /subdirectories %SystemDrive% /grant=administrators=fsubinacl /subdirectories %SystemDrive% /grant=system=f Link to comment Share on other sites More sharing options...
dboone Posted October 12, 2005 Author Share Posted October 12, 2005 Sounds great guys, I'll give it a shot today.Off to work I go.. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now