Need power-shell solution to Take ownership of file and delete it

I, User X, use miniconda for python/analytics purposes. Whenever it downloads a new package it creates file in userAppDataLocalContinuumminiconda3…

Recently I was unable to add new pkgs, it kept giving me Error: “Permission Denied”.

I decided to uninstall and reinstall the whole thing, but wasn’t able to delete some powershell files in it.

I don’t get it. It says it needs permission from ‘User X’. I am User X!

command: whoami also says I am User X.

So far I’ve tried the following.

remove-item .conda-hook.ps1 ==>[Error: Access Denied]

remove-item .conda-hook.ps1 -force ==>[Error: Invalid Argument]

remove-item -force .conda-hook.ps1 ==>[Error: Invalid Argument]

del .conda-hook.ps1 ==>[Error: Access Denied]

–[Tried this in both powershell and cmd]

takeown /f .conda-hook.ps1 ==>[Error: Access Denied]

Tried the same after rebooting and also by Running as admin.

Please help me delete this, without deleting it I cannot reinstall miniconda/anaconda. Preferably give the solution as powershell commands instead of a script.

submitted by /u/zephyr_33
[link] [comments]

Leave a Reply