MSFN Forum: Accessing files after mount - MSFN Forum

Jump to content



Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Accessing files after mount

#1 User is offline   s7even 

  • Newbie
  • Group: Members
  • Posts: 14
  • Joined: 29-October 09

Posted 08 November 2009 - 08:33 AM

hi all

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 ?


thanks


#2 User is offline   MrJinje 

  • Tool™ Developer
  • Group: Developers
  • Posts: 862
  • Joined: 14-October 09
  • OS:none specified
  • Country: Country Flag

  Posted 08 November 2009 - 08:37 AM

View Posts7even, on Nov 8 2009, 08:33 AM, said:

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 Info

After 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.

This post has been edited by MrJinje: 08 November 2009 - 09:08 AM


#3 User is offline   s7even 

  • Newbie
  • Group: Members
  • Posts: 14
  • Joined: 29-October 09

Posted 08 November 2009 - 10:05 AM

thanks a lot for your answer but it doesn't work
i installed the reg and i have the "take ownership" in my menu
when 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 trustedinstaller

i also would like to know if it is possible to use it automatically in my batch so everything is automated

This post has been edited by s7even: 08 November 2009 - 10:08 AM


#4 User is offline   MrJinje 

  • Tool™ Developer
  • Group: Developers
  • Posts: 862
  • Joined: 14-October 09
  • OS:none specified
  • Country: Country Flag

  Posted 08 November 2009 - 10:29 AM

Have a read over here.

TrustedInstaller Ownerships/Permissions

There is a couple other links at the end of the post that may be interesting too. (for batch scripting these things)

This post has been edited by MrJinje: 08 November 2009 - 10:29 AM


#5 User is offline   s7even 

  • Newbie
  • Group: Members
  • Posts: 14
  • Joined: 29-October 09

Posted 08 November 2009 - 12:55 PM

thanks again for you quick answer

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"

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 done

sorry if i look stupid but i'm just learning

#6 User is offline   MrJinje 

  • Tool™ Developer
  • Group: Developers
  • Posts: 862
  • Joined: 14-October 09
  • OS:none specified
  • Country: Country Flag

  Posted 09 November 2009 - 04:52 AM

Quote

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.

Quote

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 done
Icacls 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.

Quote

sorry if i look stupid but i'm just learning
We all gotta learn sometime

Quote

takeown /F "%WINDIR%\System32\sppcc.dll"
icacls %WINDIR%\System32\sppcc.dll /grant administrators:F
icacls %WINDIR%\System32\sppcc.dll /grant %USERNAME%:RX
This 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

#7 User is offline   s7even 

  • Newbie
  • Group: Members
  • Posts: 14
  • Joined: 29-October 09

Posted 09 November 2009 - 05:07 AM

thanks again for help

i was able to delete some registry key with just takeown of the system32\config directory


i think my mistake was to try to takeown of everything, brutal force FTL :D

do you think it's better to take right on just the files i will modify or the directory ?

#8 User is offline   MrJinje 

  • Tool™ Developer
  • Group: Developers
  • Posts: 862
  • Joined: 14-October 09
  • OS:none specified
  • Country: Country Flag

Posted 09 November 2009 - 05:15 AM

View Posts7even, on Nov 9 2009, 05:07 AM, said:

thanks again for help

i was able to delete some registry key with just takeown of the system32\config directory


i think my mistake was to try to takeown of everything, brutal force FTL :D

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.

This post has been edited by MrJinje: 09 November 2009 - 05:18 AM


#9 User is offline   s7even 

  • Newbie
  • Group: Members
  • Posts: 14
  • Joined: 29-October 09

Posted 09 November 2009 - 06:09 AM

thanks for eveything, i think i have all i need for now :)

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy