授予对外部驱动器上用户文件夹的访问权限


9

我最近用SSD取代了笔记本的HDD,并在SSD上重新安装了Windows 7。我为“旧”硬盘购买了一个球童,我可以从SSD成功启动Windows。

我可以将旧的 HDD视为外部驱动器。但是,我无法访问它的用户文件夹。当我尝试打开用户文件夹时,出现以下错误:

在此处输入图片说明

如果单击Continue,则什么都没有发生。绿色的条显示并加载(例如“我正在获取文件!”),但是一旦到达末尾,我就无法进入该文件夹。

有任何想法吗?




1
@ techie007,请添加您的回答作为答案,以便BeNdErR可以标记它并结束此问题。否则,请将其标记为重复
Ganesh R.


@GaneshR。我会把它标记为骗子,但是我今天没有投票。
Ƭᴇcʜιᴇ007

Answers:


7

您可以使用该命令takeown来获取用户文件夹的所有权,从而重新获得对旧硬盘上文件(或其他任何文件)的访问权限。

摘自以上techie007的评论。

C:\>takeown /?

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

Vista中的示例。在Windows 7上应该类似。


太棒了,我也可以确认在Windows 10上也可以使用
Numeron

1
+1是因为TAKEOWN /F E:\Users\*我为我工作,尽管我为我工作了:TAKEOWN /F E:\Users\user\*
约翰D

我必须以cmd管理员身份运行,并且还需要递归运行:TAKEOWN /F E:\Users\* /R
Felix
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.