I am using PowerShell of Windows 10.
This might be so basic question.
I can't delete the folder by Remove-Item.
PS C:\Users\whitebear> Remove-Item MQL_Set. + remove-item MQL_Set + ~~~~~~~~~~~~~~~~~~~ + CategoryInfo : PermissionDenied: (C:\Users\whitebear\MQL_Set:String) [Remove-Item], UnauthorizedAccessExce ption + FullyQualifiedErrorId : ItemExistsUnauthorizedAccessError,Microsoft.PowerShell.Commands.RemoveItemCommand However there is a folder.
PS C:\Users\whitebear> dir Mode LastWriteTime Length Name ---- ------------- ------ ---- d-r--- 2021/01/22 0:20 3D Objects d-r--- 2021/01/22 0:20 Contacts d-r--- 2021/05/06 16:46 Desktop d-r--- 2020/05/10 4:07 Documents d-r--- 2021/05/03 0:49 Downloads d-r--- 2021/01/22 0:20 Favorites d-r--- 2021/01/22 0:20 Links d----- 2021/05/09 11:14 MQL_Set I am not familiar with PowerShell
Please help me.
Thank you very much.
11 Answer
Permission denied in Powershell cases can be avoided with running PowerShell as an administrator.
- Click Win-R and type PowerShell.
- Press Ctrl-Shift-Enter to run it as an administrator.
- Press yes on the UAC window, allowing changes to be made.
- Run your command again using this new Admin window.