Locked out of my own folder: TakeOwn help

edited December 2005 in Science & Tech
I have two partitions on my computer, one for windows and one for my documents which had folders set to be private. I recently reformatted only to realize that I could no longer access those private folders. I have the "TakeOwn" program and it appears to work for individual files and folders, but I have thousands that I need to unlock and it would take forever to copy and paste file names. Is there a way to unlock one folder and its subsequent files/folders?

Comments

  • profdlpprofdlp The Holy City Of Westlake, Ohio
    edited December 2005
    You need to use the /R switch. :)
    TAKEOWN [/S system [/U username [/P [password]]]]
            /F filename [/A] [/R [/D prompt]]
    
    Description:
        This tool allows an administrator to recover access to a file that
        was denied by re-assigning file ownership.
    
    Parameter List: 
        /S           system          Specifies the remote system to
                                     connect to.
    
        /U           [domain\]user   Specifies the user context under
                                     which the command should execute.
    
        /P           [password]      Specifies the password for the
                                     given user context.
                                     Prompts for input if omitted.
    
        /F           filename        Specifies the filename or directory
                                     name pattern. Wildcard "*" can be used
                                     to specify the pattern. Allows
                                     sharename\filename.
    
        /A                           Gives ownership to the administrators
                                     group instead of the current user.
    
        /R                           Recurse: instructs tool to operate on
                                     files in specified directory and all 
                                     subdirectories.
    
        /D           prompt          Default answer used when the current user
                                     does not have the "list folder" permission
                                     on a directory.  This occurs while operating
                                     recursively (/R) on sub-directories. Valid 
                                     values "Y" to take ownership or "N" to skip.
    
        /?                           Displays this help message.
    
        NOTE: 1) If /A is not specified, file ownership will be given to the
                 current logged on user.
    
              2) Mixed patterns using "?" and "*" are not supported.
    
              3) /D is used to suppress the confirmation prompt.
    
    Examples: 
        TAKEOWN /?
        TAKEOWN /F lostfile
        TAKEOWN /F \\system\share\lostfile /A
        TAKEOWN /F directory /R /D N
        TAKEOWN /F directory /R /A
        TAKEOWN /F *
        TAKEOWN /F C:\Windows\System32\acme.exe
        TAKEOWN /F %windir%\*.txt
        TAKEOWN /S system /F MyShare\Acme*.doc
        TAKEOWN /S system /U user /F MyShare\foo.dll
        TAKEOWN /S system /U domain\user /P password /F share\filename
        TAKEOWN /S system /U user /P password /F Doc\Report.doc /A
        TAKEOWN /S system /U user /P password /F Myshare\* 
        TAKEOWN /S system /U user /P password /F Home\Logon /R
        TAKEOWN /S system /U user /P password /F Myshare\directory /R /A
    
  • edited December 2005
    I typed "takeown /f directory /r" and it says "Unable to assign Administrator as owner; Log on as Administrator and try again"

    I'm already in and Administrator account as I can unlock individual files/folders by typing "takeown filename"
  • profdlpprofdlp The Holy City Of Westlake, Ohio
    edited December 2005
    Try using the /u (user) switch along with the others.
  • edited December 2005
    I'm still getting the same message..

    TAKEOWN /U username /F folder /R
  • profdlpprofdlp The Holy City Of Westlake, Ohio
    edited December 2005
    Try logging off and logging back on as Administrator.

    You may want to take a look at CACLS as well.
  • edited December 2005
    I've tried booting in safe mode to get in to the Administrator account, but I get the same results.

    I've played around with CACLS, but I'm having trouble figuring out exactly what I need to type.
  • profdlpprofdlp The Holy City Of Westlake, Ohio
    edited December 2005
    Try adding runas and specifying Administrator.

    /user:ComputerName\AdministratorAccountName

    Hang in there - I'm sure we'll get it whipped sooner or later. :D
Sign In or Register to comment.