Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
File extension too long
#1
In what seems like a classical case of a spell gone wrong, I accidentally created a file that had a name 70+ characters long! It's also a file that I don't want >_>

Here's what I tried:
  • Right-clicking on it. Apparently the delete option doesn't come up >_>
  • Dragging it to the Recycle Bin. "File name or extension is too long"
  • CMD's del and rename command.
  • Change the name. Vista complains and makes a dinging noise instead >_>
  • Deleting the folder it is located in. At least it's in the Recycle Bin now. Everything above didn't work here either.

...help? =(
Reply
#2
I don't see restarting the computer in the list of things you've tried. It's likely that some thing is still calling upon that file, hence why it's being so anal about getting deleted.
Reply
#3
KajitiSouls Wrote:In what seems like a classical case of a spell gone wrong, I accidentally created a file that had a name 70+ characters long! It's also a file that I don't want >_>

Here's what I tried:
  • Right-clicking on it. Apparently the delete option doesn't come up >_>
  • Dragging it to the Recycle Bin. "File name or extension is too long"
  • CMD's del and rename command.
  • Change the name. Vista complains and makes a dinging noise instead >_>
  • Deleting the folder it is located in. At least it's in the Recycle Bin now. Everything above didn't work here either.

...help? =(

Ideas:
  • If the file path contains spaces, make sure you enclose the path in quotes when doing a command-line delete!

  • Get the file in a directory all by itself and do a command-line del "c:\directory\*" to delete all files in the directory.

  • Try using command-line del but refer to the file by its short name, <first 6 characters of name>~1.<extension>. veryveryverylongfilename.txt -> veryve~1.txt

  • Try using command-line del but refer to the file using extended length syntax: del "\\?\C:\directory1\directory2\veryveryveryverylongfilename.txt"


I'm going to take a guess and say the total file path is over 260 characters.
Reply
#4
Try checking the disk for errors? Maybe you somehow created an erroneous file name (which the OS shouldn't allow in the first place, but when you mention "spell" perhaps you bypassed some sanity check).

Boot to a Linux CD (such as System Rescue CD) and mount the disk with that, try to remove the file that way.

@Spaz: Wow, didn't realize there was a special syntax for "extended length!"
Reply
#5
butterfli Wrote:I don't see restarting the computer in the list of things you've tried. It's likely that some thing is still calling upon that file, hence why it's being so anal about getting deleted.

I dunno which error would get thrown first, but it was suppose to be a .png, and the computer even thinks so. It cannot be used in any way that I could find however.

Spaz Wrote:Ideas:
  • If the file path contains spaces, make sure you enclose the path in quotes when doing a command-line delete!

  • Get the file in a directory all by itself and do a command-line del "c:\directory\*" to delete all files in the directory.

  • Try using command-line del but refer to the file by its short name, <first 6 characters of name>~1.<extension>. veryveryverylongfilename.txt -> veryve~1.txt

  • Try using command-line del but refer to the file using extended length syntax: del "\\?\C:\directory1\directory2\veryveryveryverylongfilename.txt"


I'm going to take a guess and say the total file path is over 260 characters.

File name does not have any spaces in it. It does have a period near the beginning however. In the Recycle Bin, the file directory isn't over 260 characters.

Um, upon typing this, I decided to clear the Recycle Bin again since I had more scrap data from my programming, and miraculously the damned file actually got deleted. I wanted to try out your suggestions, but then again I didn't want to make another bad file like this one because it was causing me so much trouble. Topic can close I guess.
Reply
#6
"path" refers to directory + filename, not just directory.

http://msdn.microsoft.com/en-us/library/...S.85).aspx has everything you ever wanted to know and more about file names in Windows. In particular: "The shell and the file system have different requirements. It is possible to create a path with the Windows API that the shell user interface might not be able to handle." I'm going to guess whatever you used to create the file uses \\?\ syntax when creating a file and so bypasses some of the sanity checks.
Reply


Forum Jump:


Users browsing this thread: