skip to Main Content

I have "This is no longer located in C:UsersKarina. Verify the item’s location and try again" error when I try to move/ delete/ open file situated in my "Users" folder. It appeared because I wanted to create .gitignore but ended up creating .gitignore. — I didn’t spesified the extension. I tried to rename it with Command Promp by this command:

DIR /A /X /P
RENAME (name of the problematic file) (some other name)
EXIT

But it says it couldn’t find this item either. I know we can delete a file in Command Promp too but I am a bit afraid to try it out, as it is just a file, not a folder — so when I will type a file location, I will type C:UsersKarina. Won’t it delete my "Karina" folder entirely?

Surprisingly I can open up this .gitignore. in my Photoshop. So I wanted to save it after editing it there, just so I can later delete it. But I cannot do that too.

2

Answers


  1. Try first to delete that file (or rename it), using a CMD opened with elevated privileges:

    del "\?C:fullpathto.gitignore."
    # or
    ren "\?C:fullpathto.gitignore." "\?C:fullpathto.gitignore"
    

    Then you can see if the move proceeds.

    Login or Signup to reply.
  2. This one worked for me after several searches

    rd /s \?Drive:badfolderpath
    

    This will delete the folder containing the problematic file

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search