s7even Posted November 8, 2009 Share Posted November 8, 2009 hi alli mounted my wim, and now i'd like to edit / delete some files using a .bat but they all seem to be protected. what can i do to get acces ?thanks Link to comment Share on other sites More sharing options...
MrJinje Posted November 8, 2009 Share Posted November 8, 2009 (edited) i mounted my wim, and now i'd like to edit / delete some files using a .bat but they all seem to be protected. what can i do to get acces ?Easy, you either need to take ownership via elevated command prompt, or use the TakeOwnership.reg and right click to take ownership, which makes things easier.Take Ownership Reg InfoAfter ownership is sorted, run your BAT and it should work. EDIT: If you still cannot take ownership of a particular file, try taking ownership of it's folder. Edited November 8, 2009 by MrJinje Link to comment Share on other sites More sharing options...
s7even Posted November 8, 2009 Author Share Posted November 8, 2009 (edited) thanks a lot for your answer but it doesn't worki installed the reg and i have the "take ownership" in my menuwhen i use it on a file or directory a cmd windows opens and closes really fast but i still can't modify the files mounted. It says i need to get autorisation from trustedinstalleri also would like to know if it is possible to use it automatically in my batch so everything is automated Edited November 8, 2009 by s7even Link to comment Share on other sites More sharing options...
MrJinje Posted November 8, 2009 Share Posted November 8, 2009 (edited) Have a read over here. TrustedInstaller Ownerships/PermissionsThere is a couple other links at the end of the post that may be interesting too. (for batch scripting these things) Edited November 8, 2009 by MrJinje Link to comment Share on other sites More sharing options...
s7even Posted November 8, 2009 Author Share Posted November 8, 2009 thanks again for you quick answeri tried to use the takeown command in my batch for a directory and i think it worked but now it says i need autorisation of "my user account" do i have to use the icacls command too ? what does it do ? i tiried it but i get an error message, dunno how to translate it exactly : mapping between account and security ID is not donesorry if i look stupid but i'm just learning Link to comment Share on other sites More sharing options...
MrJinje Posted November 9, 2009 Share Posted November 9, 2009 i tried to use the takeown command in my batch for a directory and i think it worked but now it says i need autorisation of "my user account"That is because you have not given yourself full permission yet (even though you now own the files) Halfway done.do i have to use the icacls command too ? what does it do ? i tiried it but i get an error message, dunno how to translate it exactly : mapping between account and security ID is not doneIcacls gives your account permissions to access an object (file or folder). So in short, yes you both have to take ownership and use icacls to grant your self permissions after taking ownership.sorry if i look stupid but i'm just learningWe all gotta learn sometimetakeown /F "%WINDIR%\System32\sppcc.dll"icacls %WINDIR%\System32\sppcc.dll /grant administrators:Ficacls %WINDIR%\System32\sppcc.dll /grant %USERNAME%:RXThis example, takes ownership of the sppcc.dll file, and the second command grants all local administrators Full (F) permissions. Third command shows how to use a batch variable / and how to set Read/Write (RX). Here are more examples + icacls syntax Link to comment Share on other sites More sharing options...
s7even Posted November 9, 2009 Author Share Posted November 9, 2009 thanks again for helpi was able to delete some registry key with just takeown of the system32\config directoryi think my mistake was to try to takeown of everything, brutal force FTL do you think it's better to take right on just the files i will modify or the directory ? Link to comment Share on other sites More sharing options...
MrJinje Posted November 9, 2009 Share Posted November 9, 2009 (edited) thanks again for helpi was able to delete some registry key with just takeown of the system32\config directoryi think my mistake was to try to takeown of everything, brutal force FTL do you think it's better to take right on just the files i will modify or the directory ?Smaller directories yes, larger directories no. Config directory is relatively small (number of files-wise), but it would take nearly half an hour to take ownership of the entire Windows directory. (depending on you HDD speed) The number of files in the directory is your acid-test. See what I'm saying. Edited November 9, 2009 by MrJinje Link to comment Share on other sites More sharing options...
s7even Posted November 9, 2009 Author Share Posted November 9, 2009 thanks for eveything, i think i have all i need for now Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now