0

Edit: Now, the situation seems to have fixed itself - I checked again - and the file is just gone. I removed the parent folder without any problems. I did literally nothing. I have no idea what is going on here.


I have no idea what happened with permissions to my file. I created a file using VSCode in a git repository. Then, as far as I remember, I decided that it's of no use and decided to delete it using git that is installed under ubuntu using Windows Subsystem Linux with git reset --hard. Instead I got an error that access was denied. Now I have a file that, apparently, can survive anything. Trying to remove it gives me an error that I need a permission:

enter image description here

Trying to remove it from ubuntu makes it even funnier:

enter image description here

(note that I'm trying to remove a whole directory and it specifically complains that the file doesn't exist)

So I tried to change permissions to the file:

enter image description here

Clicking Continue yelds literally no effect. Trying to change permissions to a containing folder complains that access was denied:

enter image description here

And trying to remove the parent folder says that I need permissions from... myself:

enter image description here

Do you have any idea what can I do to get rid of it? At some point I managed to remove a whole project folder. Cool. Then I cloned the repo again in the same place... and the file was there, marked as untracked by git (because I never added it to the repo). I'm lost.

4
  • "(note that I'm trying to remove a whole directory and it specifically complains that the file doesn't exist)" -- the OS doesn't have a function to remove a directory with its contents, so the command needs to remove the individual files first, and will be able to remove the directory only once it's empty. Doesn't make the actual error message any less weird though.
    – user1686
    Jan 25, 2019 at 13:37
  • @grawity -R option should remove contents recursively; and if the file doesn't exist then, logically, it should not pick it up at all. After all, why try to remove a file that doesn't exist at all, where I didn't even specify that it should be removed. Jan 25, 2019 at 13:49
  • May be the file was in use? Opened in with other application, so it can not be deleted, since there is a handle that points to it... And after closing the app, the handle is released and the file is deleted. That is the only logical explanation I can come with.
    – nephewtom
    Jan 25, 2019 at 16:38
  • @nephewtom not really - I restarted the computer in the meantime and it didn't help with anything. Also, then it should just throw an error that the file is in use instead of giving cryptic messages. Jan 28, 2019 at 9:53

1 Answer 1

0

You likely need to take ownership of the file - current ownership is probably SYSTEM or something, which you need to change to your user (andministrator) account.

Bring up the file Properties box, then the security tab, then click the "Advanced" linkbutton. That window will tell you who the current owner is, and there is another linkbutton there to change this. (You can see this linkbutton in your screenshot above)

4
  • I wish! If you take a look at this image: i.stack.imgur.com/uUhfg.png I tried to do exactly that, but apparently I don't even have permissions to see the permissions. Jan 25, 2019 at 13:35
  • @Michał-Sadowski - Are you sure you're using an administrator account? And the error you refer to is with the "Continue" button - do you also get this with the "Change" (owner) one above?
    – PSU
    Jan 25, 2019 at 13:46
  • I'm sure. Now, the situation seems to have fixed itself - I checked again - and the file is just gone. I removed the parent folder without any problems. I did literally nothing. I have no idea what is going on here. Jan 25, 2019 at 13:52
  • 1
    It's just your computer messing with you. They do that. :)
    – PSU
    Jan 25, 2019 at 13:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.