Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Remove-Item does not work (Permissions) but "cmd /c 'rd /s /q directory' " works fine

$
0
0

Hallo,

I would like to delete a directory of a user with the powershell (I 've run it as administrator):

PS C:\Users> Remove-Item DIRECTORY -Force -Recurse

    + CategoryInfo          : PermissionDenied:...[Remove-Item], UnauthorizedAccessException
    + FullyQualifiedErrorId : RemoveItemUnauthorizedAccessError,Microsoft.PowerShell.Commands.RemoveItemCommand


I can delete it with cmd:

PS C:\Users> cmd /c 'rd /s /q DIRECTORY'

Why is this possible?

 

Robert

 


Viewing all articles
Browse latest Browse all 6937

Trending Articles