I was working on a quick in house template program for C# unit tests so I used java to generate them.

The program simply opens the template file, replaces my regex patterns and saves the info in a new file in my test project.

The program works now as intended, but earlier I accidentally selected the entire regex match instead of my grouping and named the files as follows "public class myTestClass".

I didn't think it was a big deal so I just tried to delete the new files that were made and the file system refused. I then brushed the issue to the side while I finished the template program. After I was done I then killed all my java instances and reset my PC. after booting I tried to push my changes with git but the files still persisted and were still undeletable.

The error I keep getting via file explorer and cmd is "This is no longer located in C:........\myFolder" Verify the items location and try again.

This is an issue because no matter what I try the files persists and rendered my repository useless. I have already manually fixed and pushed my changes to git but I want to be able to solve this issue so that I may continue to use the original project path.

The java program simply created a new File() with the cwd + name of new file then flushed the String.getBytes() to the file

The files are all 0kb and have no working information present in the properties The files do show up in all searches and indices even after resetting the search index

Things I have tried:

  • reboot
  • shutdown
  • unplug PSU for 30 seconds
  • chkdsk /r /f
  • cmd rm PUBLIC~1 **The shorthand name for the file I got using dir /x
  • LockHunter on the file said it was not locked by any process
  • safe mode can't do it either
  • I have tried to move the files to a shorter path unsuccessfully
  • shortening all the folder names did not work either
  • rebuilt search index

Sorry if this is not the right place for this question but I am out of ideas.


I have solved the issue finally.

I still don't know the root cause of this issue but here is how I was able to fix it. I simply added the files to archive with 7zip and ticked the box that said "delete files after archiving" and this finally worked

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.