takeown and icacls commands

Discussion in 'Software' started by michaelsmith1983, Aug 15, 2012.

  1. michaelsmith1983

    michaelsmith1983 Private E-2

    I hope this is the right forum to post this ; if not please re-direct me and sorry for the trouble.
    I have some trouble taking ownership of system files on Vista SP2
    For example
    >takeown /f c:\Users\Meself\Documents\phile.pdf

    works well after the command prompt


    >icacls c:\Users\Meself\Documents\phile.pdf
    gives an error message invalid parameter

    Any help gratefully appreciated

    Thanks
    Mike
     
  2. PC-XT

    PC-XT Master Sergeant

    There appear to be different versions of icacls with different syntax. I've heard of some strange troubles, such as spaces in the path, even inside quotes, apparently causing errors.

    Have you tried
    Code:
    c:
    cd \Users\Meself\Documents
    icacls phile.pdf
    That seems to work best on Vista.

    As for the right forum, batch programmers may know about this command, so asking here is good IMO, but people in Software may be able to help, too.
     
  3. theefool

    theefool Geekified

    Are you running the this in an elevated command prompt?
     
  4. michaelsmith1983

    michaelsmith1983 Private E-2

    Dear Theefool
    I am not sure what an elevated command prompt is.
    I used
    Click Start, click All Programs, click Accessories, right-click Command Prompt, and then click Run as administrator

    But my vista pc which used to ask me to enable UAC (user acct ctrl) doesn't do so any more, runs new programs without asking, even though UAC is enabled
    What do you think?
    Thanks so much
    Mike
     
  5. michaelsmith1983

    michaelsmith1983 Private E-2

    Thanks very much as icacls is working or gives a success message for the 1st time. However I still dont own the file which does not allow making a copy to my Desktop and also resists deletion after which happened as below
    cd \Users\MichaelSmith1983-PC\

    takeown /f ntuser.dat.LOG1 [Enter]

    SUCCESS the file <or folder> C:\Users\Meself\ntuser.dat.LOG1 is now owned by user "MichaelSmith1983-PC\MichaelSmith1983"

    icacls ntuser.dat.LOG1 [Enter]
    ntuser.dat.LOG1 MichaelSmith1983-PC\MichaelSmith1983:<I><F>
    NT \AUTHORITY\SYSTEM:<I><F>
    Successfully processed 1 files, Failed processing 0 files
    .....
    when I right click+copy, I get
    "The action can't be completed because the file is open in another program. Close the file and try again"
    What s wrong? Thanks very much, Mike
     
  6. michaelsmith1983

    michaelsmith1983 Private E-2

    .............................................................................

    Thanks very much as icacls is working or gives a success message for the 1st time. However I still dont own the file which does not allow making a copy to my Desktop and also resists deletion after which happened as below
    cd \Users\MichaelSmith1983-PC\

    takeown /f ntuser.dat.LOG1 [Enter]

    SUCCESS the file <or folder> C:\Users\Meself\ntuser.dat.LOG1 is now owned by user "MichaelSmith1983-PC\MichaelSmith1983"

    icacls ntuser.dat.LOG1 [Enter]
    ntuser.dat.LOG1 MichaelSmith1983-PC\MichaelSmith1983:<I><F>
    NT \AUTHORITY\SYSTEM:<I><F>
    Successfully processed 1 files, Failed processing 0 files
    .....
    when I right click+copy, I get
    "The action can't be completed because the file is open in another program. Close the file and try again"
    What s wrong? Thanks very much, Mike
    Edit/Delete Message
     
  7. michaelsmith1983

    michaelsmith1983 Private E-2

    ..............................................
     
  8. PC-XT

    PC-XT Master Sergeant

    If the file is open, (currently being handled by some code,) many file operations will be blocked, even if you have permission to handle the file yourself. This is to avoid data corruption if two pieces of code are trying to do conflicting operations on the same file. If that file is in the folder of the administrator account you are using, or the account you are logged in, you may be able to log in as a different administrator account to copy the file. (Some code that runs when you use that account may be opening the file.)
     
  9. theefool

    theefool Geekified

    When you stated running as administrator, that is running it an elevated state.

    For icacls, you could try safe mode.
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds