Vista安装在NTFS分区上,很多系统文件的所有权都属于系统而不是用户,因此我们在操作这些文件时,就会出现由于权限不够而拒绝访问的情况。

Vista提供了一个命令行工具“takeown”,该工具以重新分配文件所有权的方式允许管理员重新获取先前被拒绝访问的文件访问权。命令行操作太麻烦,国外有人将这样的操作整合到了文件右键菜单中:

image

如图,点击“取得权限”,即可获得该文件的访问权。

这个菜单是通过一个注册表文件来添加的,内容如下:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\*\shell\runas]
@=”取得权限”
“NoWorkingDirectory”=”"

[HKEY_CLASSES_ROOT\*\shell\runas\command]
@=”cmd.exe /c takeown /f \”%1\” && icacls \”%1\” /grant administrators:F”
“IsolatedCommand”=”cmd.exe /c takeown /f \”%1\” && icacls \”%1\” /grant administrators:F”

[HKEY_CLASSES_ROOT\Directory\shell\runas]
@=”取得权限”
“NoWorkingDirectory”=”"

[HKEY_CLASSES_ROOT\Directory\shell\runas\command]
@=”cmd.exe /c takeown /f \”%1\” /r /d y && icacls \”%1\” /grant administrators:F /t”
“IsolatedCommand”=”cmd.exe /c takeown /f \”%1\” /r /d y && icacls \”%1\” /grant administrators:F /t”

卸载:

Windows Registry Editor Version 5.00

[-HKEY_CLASSES_ROOT\*\shell\runas]

[-HKEY_CLASSES_ROOT\Directory\shell\runas]

将上述文字分别存储为“安装.reg”和“卸载.reg”文件,再将“安装.reg”导入注册表即可。或者直接从这里下载这两个文件。

  转载必须注明文章来源于技客乐趣,否则后果自负!

相关文章:

随机文章:

    

    5 个评论 to “在Vista下快速取得文件操作权限”

    1. AvatarIzual_Yang
      1

      还是TotalCmd王道,cm_EditOwnerInfo

      Reply to this comment.
    2. Avatarwindows 7
      2

      这个好强大呀,对了,博主,你说windows 7将会取代vista吗?

      Reply to this comment.
    3. Avatar小 王
      3
      Author Comment

      我想是的,虽然现在Windows7相关的信息还不充足,但是就已有的信息来看,Windows7肯定会取代Vista,但是我怀疑它能不能替代XP。

      Reply to this comment.
    4. Avatar小龙
      4

      我还用的XP,但历史的车轮一直是向前,尽管曲折,但明显长江后浪推前浪啊

      Reply to this comment.
    5. Avatar张恺
      5

    喷喷口水

    尊姓大名

    电子邮箱 (不会被公开)

    网址

    XHTML: 你可以使用这些标记: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

    评论预览:

    Bad Behavior has blocked 2007 access attempts in the last 7 days.

    Copy Protected by Tech Tips's CopyProtect Wordpress Blogs.