question

hehe-5498 avatar image
0 Votes"
hehe-5498 asked CarlFan-MSFT answered

The takeown command was denied access

我在administraotr用户下对system32中的一个系统文件 x.dll 使用命令
takeown /f x.dll
结果居然显示访问拒绝?
其他所有系统文件都可以更改权限,把owner改为“administrator”,只有这个文件的owner是 “...”
求解



Translated from Chinese to English:

I used the command
takeown /f x
.dll under the administraotr user to show access denial for a system file x.dll in system 32?
All other system files can change permissions to "administrator" and only
the file's owner is "..." solve

windows-server
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

CarlFan-MSFT avatar image
0 Votes"
CarlFan-MSFT answered

你好,
如果用icacls命令来更改权限是否可以。
icacls "full path of folder or drive" /setowner "Administrators" /T /C
我想有时它只是不让您更改权限,可能因为一些进程正在使用该文件,或者如果您试图编辑一个文件夹的属性,那么一个进程有一个文件在该目录或子目录中打开。
或者是这个文件本身所属的文件夹权限您需要先赋予,并更改了继承权限后,才可以更改文件夹中的文件权限。
或者您可以尝试使用一下process monitor这个工具,看一下更改文件权限的过程,过程中访问那些注册表或者文件夹的时候出现access deny,导致这个文件无法更改。
如果回答是有帮助的, 请将其标记为答案, 可以帮助其他有相同问题的社区成员, 并快速找到有用的答复。

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.