问题描述
现在,众所周知,takeown.exe
希望 cmd.exe
以管理员权限运行。因此,要在批处理文件中执行(大部分时间从非管理员 cmd 窗口调用),我运行:
call runas /noprofile /user:"!domain!\!runasUsr!" "cmd /k takeown /f ""!entity!"" /r"
但是,即使我将管理员组中包含的名称作为 !runAsUsr!
传递,我还是得到:
ERROR: the user currently connected does not have the ownership privileges on file/folder ...
我尝试设置!runAsUsr! = Administrators
,但不幸的是我不记得密码(如果我设置了一个...)。为此,我可以更改计算机管理器(或 net
命令),但我不太了解该命令的工作原理,因此我不会搞砸。
但是,我仍然不明白为什么我会收到该错误,因为我传递的用户在管理员组内..
我从计算机管理员那里看到计算机管理的默认帐户是用户:组的管理员:管理员,所以这可能是问题所在。那么,如何设置其他账号具有相同的权限?
我也试过
call runas /noprofile /user:"!domain!\Administrator" "cmd /k takeown /f ""!entity!"" /r"
出现以下错误:
ERROR RUNAS: impossible to execute - cmd /k takeown /f "C:\Program Files\Microsoft VS Code\resources\app\extensions\css" /r
1327: restriction on user account do not allow this user to get access.
For example,empty password field not allowed,access times restrictions or application of restriction criteria.
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)