Can't delete file

persius

Member
Messages
61
This is a new one for me because I've never encountered this problem before. I have a directory with 1 file in it but windows won't allow me to delete it. I've attached a screenshot of the warning that pops up.
I have attempted to delete the directory along with the file and just the file alone without success. I have also tried to rename the file but that option is also not available.

Any help will be appreciated.
 

Attachments

  • screen shot.jpg
    screen shot.jpg
    72.9 KB · Views: 198
Hello, a couple of ways. You can take ownership to get access to the file (use carefully, do not take ownership of whole drives, etc.)


Install a small program called Lockhunter which will either be able to unlock the file to delete it, or offer to delete it on next restart


Good luck

A Guy
 
Hello, a couple of ways. You can take ownership to get access to the file (use carefully, do not take ownership of whole drives, etc.)


Install a small program called Lockhunter which will either be able to unlock the file to delete it, or offer to delete it on next restart


Good luck

A Guy
A Guy: Thanks for your suggestion. I'll give that a try.
 
Hello, a couple of ways. You can take ownership to get access to the file (use carefully, do not take ownership of whole drives, etc.)


Install a small program called Lockhunter which will either be able to unlock the file to delete it, or offer to delete it on next restart


Good luck

A Guy
Hi again. I tried both your suggestions and the result is the same. I'm informed that the name of the file is too long and therefore I can't delete it.
When I look at the type of file this is, it's listed as: internet shortcut
 
Hmmm, Unlocker didn't give you the option to delete the file on next reboot? See if you can right click on the file and change the extension to .txt, then try again to delete it

A Guy
 
Wow, here are a whole bunch of thoughts. (As-is, no warranty).

1) Apparently you're getting an error message that the path or filename is too long for Windows to delete the file. I'm guessing the problem is more about communicating to the Windows shell what file you're trying to delete, as opposed to some problem with actually deleting it. MS Command Prompt and Cygwin both provide multiple ways to specify a given file besides the full file name, for example using wild cards, regular expressions, etc. For example, I would try something like "rm A*" in Cygwin or "erase A*" in Command Prompt, where "A*" is a wildcard that expands to only the file you want to delete. Individually, I'd give this maybe a 50% chance of working, but if it doesn't work, maybe something further down this list would :)

2) Likewise, you might be able to use Command Prompt or Cygwin with wildcards to rename or move the file, so its path and filename are shorter. If you can successfully do that, I'm guessing deleting it would then work.

3) You could also try using Command Prompt or Cygwin to delete the whole directory, making sure that file is the only one in it. For example "rm -r <Directory name>" in Cygwin.

4) In the old days (when I was a kid), MS DOS used to require file names to have maximum 8 characters, upper case, and with no special characters like space or comma. If I'm not mistaken, Command Prompt can still refer to files with this type of name. In general, I think take the first 6 characters of the name, followed by ~ and a numeral. For example, "This is a long filename.txt" can also be referred to by something like THISIS~1.TXT. So I would try to use something like "erase THISIS~1.TXT" in Command Prompt.

5) Maybe a compiled program could overwrite or delete the file, as a way to circumvent the OS shell. For example, you could try opening the file with vi in Cygwin or some other low-level text editor, removing the file's contents, and re-saving. Or you could write your own compiled code to delete this file, but I would make sure to use file handling commands native to the language, like 'open' or 'write', as opposed to any command that invokes the OS shell.

6) Finally, maybe you could just overwrite the file by redirecting the output from some other command, for example "echo 'Null set' > A*" in Cygwin, where "A*" is again a wildcard that expands to just the file you want to overwrite.
 
Hi all.
I've had a chance to read all of your suggestions and to begin, you're asking the wrong person to start writing codes or dealing with DOS. In fact the last time I used DOS was.......15 years ago at the least.

Here is the screenshot of what this file looks like and what options are available to me.
 

Attachments

  • Untitled-1.jpg
    Untitled-1.jpg
    71 KB · Views: 157
The NTFS file system has a maximum file name length of 280 characters. Unless your file name is over 280 you shouldn't be getting the error your receiving. Did you even try booting to safe mode?
 
Yes I have. I've done everything that has been suggested. One detail I haven't mentioned is that this file is on a external (backup) drive. I have attempted to move it to another location and then delete but no result.
 
OK, download Download FileKiller - MajorGeeks , tiny exe file, 100% safe. Right click Run as Administrator> Press Select> Navigate to the file> Kill Files On Grid >>

A Guy
A Guy.

Thanks for your suggestion. I was very hopeful that this would work but sadly.......... no. I have no idea what is wrong with this file. As always, the reason is "file name is too long".
This makes no sense.
 

Attachments

  • Untitled-1.jpg
    Untitled-1.jpg
    78.2 KB · Views: 176
Too bad you're reluctant to use DOS. If you brought that problem to me, that's exactly what I'd use.
I'd boot up your system with my DOS Utilities Flash Drive and then run a program called "NTFS 4 DOS" which would then let me navigate to any file on the HD, and delete it if that's what I wanted to do. I've actually done that many times. Long Live DOS!

TM :cool:
 
Just an update. The problem has been resolved. It turns out that my computer reached the age where it was literally dying. The motherboard had capacitors that were popping and components were ceasing to operate correctly. My solution? I had to purchase a new PC with Win 10.
 
Just an update. The problem has been resolved. It turns out that my computer reached the age where it was literally dying. The motherboard had capacitors that were popping and components were ceasing to operate correctly. My solution? I had to purchase a new PC with Win 10.
That was an expensive solution to your problem. It would NOT have been MY solution.
So, what did you do about saving your data files from the old HD. Just curious.
TM :cool:
 
Back
Top