Cannot delete a file even when logged in as an Administrator [closed]

不羁岁月 提交于 2019-12-21 03:27:27

问题


Please could some tell me what I am doing wrong. I am trying to delete hidden folder through command line. I am running the command line as administrator but still getting message insufficient access.

Here is screenshot of my command line :

Here is the code i am trying

rmdir "c:\xampp\htdocs\prestashop\dfs"

I am getting errors like:

Cannot remove item .... You do not have sufficient access rights to perform this operation.

回答1:


Just because you are an admin doesn't automatically mean you have rights. Are you running PowerShell as an elevated user (UAC)? Have you checked the permissions of the files in question just to be sure? Are the files in use perhaps? Although if that was the case I would expect access is denied.

Have you tried also using -recurse and -force to be sure it gets them all? For what its worth rmdir is an alias for Remove-Item

Remove-Item "c:\xampp\htdocs\prestashop\dfs" -Recurse -Force

You will see, from TechNet, that -Force

Allows the cmdlet to remove items that cannot otherwise be changed, such as hidden or read-only files



来源:https://stackoverflow.com/questions/25798272/cannot-delete-a-file-even-when-logged-in-as-an-administrator

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!