Solved

Filename too long - unable to delete file

Posted on 2002-07-21
9
10,222 Views
Last Modified: 2012-05-04
Hello,

Recently I downloaded a few .mpg files through KaZaa, when i tried to open them, windows media player opened up a webpage instead. When i then tried to delete them by clicking on the filename and pressing Delete, nothing happens.
I checked the filename and it seems like the filename is extremely long and it is disguised to be short. It goes like "abc.mpg                 fgf sfgsfd fdsg.mpg" -- notice the tons of spaces in the filename.
I tried to delete the file in Command Prompt and got a "The filename or extension is too long" error.

Can anyone tell me how to handle such files? Thanks
0
Comment
Question by:Selcon
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 44

Accepted Solution

by:
CrazyOne earned 100 total points
ID: 7168413
Ok open the Command Prompt window. Now move to the folder where these file are by using the CD command Example:
CD c:\TheFolder
Now run this command
dir /x
This will give a list of the short file names like abcdefg~.mpg. And then delete the file using the short file name.


The Crazy One
0
 
LVL 22

Expert Comment

by:cookre
ID: 7168419
It's unlikely the file name alone is too long, just that in conjunction with the full path the result is too long.

From DOS, CD to the directory and try a del abc.mpg*.mpg
If there are other files that may match that mask, move them to some other directory first.
0
 
LVL 22

Expert Comment

by:cookre
ID: 7168421
Gotta love cross posts.
0
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
LVL 22

Expert Comment

by:cookre
ID: 7168422
PS: Shows you how much I know, I didn't think XP had short names
0
 
LVL 44

Expert Comment

by:CrazyOne
ID: 7168487
Actually what I suspect is happening is that the file name has some characters that are invalid to Explorer and these characters look like spaces sometimes. Hackers love to do this especially when they find a machine they can break into. They will create folders with invalid characters making the deletion of the folders a not so easy task. They are hoping the mahcine they hacked that the user isn't aware the short file name trick.
0
 
LVL 44

Expert Comment

by:CrazyOne
ID: 7168490
Selcon
Did you try to rename the files. Right click on the file and select Rename and see if it allows you to rename the file. If not then the file name does have invalid characters in it that Explorer just doesn't know how to deal with.
0
 
LVL 7

Expert Comment

by:jmiller47
ID: 7168508
Exactly. I just had a client who couldn't delete some files because of some bogus error and the problem was that someone (the last administrator) actually (somehow) created the filenames with characters that could not be used in a filename or directory name. I think it was an apostrophe but I'm not sure. I would try renaming the file. If that doesn't work, rename the directory beneath it that possibly has a strange character if one exists.
0
 

Author Comment

by:Selcon
ID: 7168612
Yep, that worked! thanks =)
I tried renaming the file to a shorter name, but win xp just doesnt let me.
0
 
LVL 44

Expert Comment

by:CrazyOne
ID: 7168618
You are welcome. :>)
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Are you unable to synchronize your OST (Offline Storage Table) file with Microsoft Exchange Server? Is your OST file exceeding 2 GB size limit? In Microsoft Outlook 2002 and earlier versions, there is a 2 GB size limit for the OST file. If the file …
If you have done a reformat of your hard drive and proceeded to do a successful Windows XP installation, you may notice that a choice between two operating systems when you start up the machine. Here is how to get rid of this: Click Start Clic…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question