Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot remove files from powershell, but can from the GUI

I am trying to remove files I generated using powershell and del, but I get this message

del : Cannot remove item C:\Users\stefano.borini\<redacted>\.tox\py36\Include\fakepq.h: You do not have sufficient access rights to perform this operation.
At line:1 char:1
+ del .\.tox\

+ ~~~~~~~~~~~
    + CategoryInfo          : PermissionDenied: (fakepq.h:FileInfo) [Remove-Item], IOException
    + FullyQualifiedErrorId : RemoveFileSystemItemUnAuthorizedAccess,Microsoft.PowerShell.Commands.RemoveItemCommand
del : Cannot remove item C:\Users\stefano.borini\<redacted>\.tox\py36\Include\fakesql.h: You do not have sufficient access rights to perform this operation.

However, I can right click the items and delete them from the windows explorer without any problem. Why?

like image 388
Stefano Borini Avatar asked May 28 '19 11:05

Stefano Borini


1 Answers

Did you run Powershell as Administrator rights?

If so, you can try to add "-force" to your command.

like image 154
Jeepm Avatar answered Sep 30 '22 00:09

Jeepm