Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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 :

enter image description here

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. 
like image 213
user2061853 Avatar asked Sep 11 '14 23:09

user2061853


People also ask

How do I force delete a file as administrator?

Open Task Manager by pressing Ctrl + Shift + Esc key. In there, find the process or program that is using the file. Right-click on it and choose End task from the to close the program. Once closed, go ahead and see if you're able to delete the file or folder.

How do you force delete a file that won't delete?

One is simply using the delete option, and the other one is deleting files permanently. When you can't delete a file normally, you can delete undeletable files Windows 10 by selecting the target file or folder and then press Shift + Delete keys on the keyboard for a try.


1 Answers

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

like image 159
Matt Avatar answered Oct 05 '22 06:10

Matt