Can't delete a file

dgingeri

2[H]4U
Joined
Dec 5, 2004
Messages
2,830
I've run into a strange issue. I'm hoping someone has seen it before.

I was doing a test restore from Backup Exec 2014 onto my backup server's secondary drive, into a directory directly intended for such things. The test restore was far larger than I expected. (BUE tends to state a restore is much smaller than it actually is if there are many subfolders.) So, I stopped the restore after it hit about 160GB and took over half the day. It was just a test restore, not a requested one, so no big deal. Well, apparently it was in the middle of restoring a file and stopped in a weird way, and now I can't delete the file from the temp drive. So, I have this "D:\Temp\Meadow\A\TVTranscript" (not the real file name, as that might give away company info) that just won't go away.

I was able to delete the other files and folders from this restore. When it comes to this one, Explorer says "Could not find this item" while the command line says "The system cannot find the file specified". I can rename the folders it is under, but any rename or delete or open command on the file just says it can't find it. I have run a chkdsk on the drive to no avail. The system has been rebooted three times since this started, so no luck in that fixing it. I believe it is an error in the NTFS master file table, but chkdsk doesn't even detect there is something wrong there.

Any advice for this?
 
Boot to a Linux LiveCD usb drive or something similar and see if you can delete the file from there.
 
Even after a reboot its locked? I dont think ever seen that problem before. Does it have a bizzare, long file name in multiple nested folders? Sometimes that can cause issues.
 
I'd make sure you have perms/ownership on the file.

Right click on the file, get properties, change ownership to your user, close properties dialog, re-open properties, give yourself full control, then delete.
 
It's not a locked file. The OS says it can't find the file.

I also can't just boot from another OS. This is in our colo. I don't have direct access to it unless I drive down there. Even then, it is difficult to use the console there. It would be very hard to justify taking an hour to drive down to the colo and mess directly with the server just for one annoying file I can't delete.
 
The rights and ownership of the file look right. I have domain admin rights, so rights aren't an issue for me, but the file and folders have "authenticated users" with full control rights anyway. If I try to change any of these, it gives the same response about not being able to find the file.
 
Have you checked to see if it is a linked file? Or perhaps there is an issue with the file structure. Some things to try:

Do a dir /x to get the full name and extension of the file. Delete using the full name.
Use a zip program to zip up the file with the option to delete after compressing.
If its a bad hard link you could try using the FSUTIL program from Microsoft.
Try running a chkdsk on the drive and see if it corrects the file error.
 
dir /x didn't show me anything I didn't already know. The file shows there with no extension. (The backup shows no extension for it, either, as does the original file on the file server.) and no special attributes.
Trying to zip it just gives me the same "could not find the file" error.
I did run chkdsk /f on that drive, and it didn't find anything to correct.

I haven't tried the FSUTIL. I'll see what I can find out about it.
 
Try this from commandline:

del \\?\D:\Temp\Meadow\A\TVTranscript

Edit: Also see if you can make a folder with that same name and see if it replaces the extension-less file, then delete that.
 
Well, "fsutil objectid delete ./tvtranscript" just came back with the same "The system cannot find the file specified" error. That was about the only command in fsutil I could find that would be applicable in this case.
 
Try this from commandline:

del \\?\D:\Temp\Meadow\A\TVTranscript

Edit: Also see if you can make a folder with that same name and see if it replaces the extension-less file, then delete that.

That delete command came back with the same error as before. I have tried both writing over the file and appending to the file using command line (dir > TVTranscript and dir >> TVTranscript) repeatedly. It just creates a new file with that same name. Same with creating a folder.

It's like a ghost of a file, no actual file, but the NTFS reference to the file is still there. Therefore the OS can't interact with it.
 
One thing you can try is see if it lets you create a symbolic link to the file, then try to delete the symbolic link.
 
I'm out of ideas. How important is that partition? Can you format the whole damn thing or move all of the data to another partition? May just need to ignore it if not. :(
 
The drive holds out recovery data for if the Backup Exec server dies and all the BE logs. I can't format it.

I guess I just have to live with that extra file stub. It isn't hurting anything. It's just annoying to not be able to empty the folder.

Thanks all for trying.
 
Can try the \\?\ path syntax again but put it in quotes. Then try adding a space at the end of the filename, or maybe even a couple spaces. I've had invalid files with spaces at the end, and just like you, I could create new files with the same apparent name.
 
Unfortunately, it is not a locked file. It is an invalid entry in the MFT. The file doesn't exist, but the entry for it does. So, that software won't work.

I know what you're saying about BE, though. I'd love to get rid of it. Even the built in Windows backup would be better, I think.

it depends on the situation. I've seen so many people using BE on their personal Windows machine and it's literally like killing a bug with a nuke! The manual alone for the software is a 700 page PDF as the software is designed for enterprise environments, and all because some stupid tech got a bonus off Symantec for installing it. In such situations Windows backup is a far more suitable tool.
 
Can try the \\?\ path syntax again but put it in quotes. Then try adding a space at the end of the filename, or maybe even a couple spaces. I've had invalid files with spaces at the end, and just like you, I could create new files with the same apparent name.
No, I used tab complete in powershell, so I know the name is right. As a matter of fact, it does have an extra space at the end of the name.
 
Just checking you tried to delete it with the quotes and space in command prompt and not in PowerShell? I vaguely recall I couldn't delete the invalid files in PowerShell for whatever reason. Can also try del /s on the \\?\ path.
 
Even after a reboot its locked? I dont think ever seen that problem before. Does it have a bizzare, long file name in multiple nested folders? Sometimes that can cause issues.
Happens a lot on NTFS, especially when the filename is too long and nested inside several folders which all have long names.

OP, try Unlocker or Deep Remove to get rid of the files. Depending on the file stubbornness, I use both.
 
Happens a lot on NTFS, especially when the filename is too long and nested inside several folders which all have long names.

OP, try Unlocker or Deep Remove to get rid of the files. Depending on the file stubbornness, I use both.

Neither worked. It's not a locked file, nor does the OS say it is locked or in use. It says it can't find the file. The MFT entry is there, but the file isn't. I think it was because of the cancelled BUE restore.
 
Neither worked. It's not a locked file, nor does the OS say it is locked or in use. It says it can't find the file. The MFT entry is there, but the file isn't. I think it was because of the cancelled BUE restore.
Unlocker has a delete feature.
 
While this is for deleting annoying "long path" or "long file" name issues, try the following to see if it works for your situation:

1. Create an empty folder ( MD d:\empty)
2. Robocopy "d:\empty" "D:\Temp\Meadow\A\TVTranscript" /purge
 
While this is for deleting annoying "long path" or "long file" name issues, try the following to see if it works for your situation:

1. Create an empty folder ( MD d:\empty)
2. Robocopy "d:\empty" "D:\Temp\Meadow\A\TVTranscript" /purge
Novel approach. It worked, sort of.

I used "robocopy d:\empty d:\TEMP\Meadow /purge". The folder Meadow was then empty, but it still wouldn't let me delete it, saying it isn't empty. I had to recreate the A directory, then delete it again, and then use the command line to delete the Meadow directory. Now, it's gone. Thank you. I never would have thought of using Robocopy.
 
To resolve these issues for currently Windows versions or windows servers is a software named "LONG PATH TOOL", I suggest everyone a software “Long Path Tool“ which can solve all the long path problems.
 
I am not sure is it worth 44$ for non business home usage and 117$ for business usage... price is a bit high for just a simple file explorer that do basic file operation things and helps to automate process in some very rare situations when you cannot operate with the file(s) because of it's long path...
 
Back
Top