?
Solved

Filename too long - unable to delete file

Posted on 2002-07-21
9
Medium Priority
?
10,241 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
9 Comments
 
LVL 44

Accepted Solution

by:
CrazyOne earned 400 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

Ok I have been working on this for some time having learned and gained certification in XenDesktop 4 along came version 5 which was released last month. Since then I have been working to deploy XenDesktop 5 in a small environment with only 2 virt…
We have adopted the strategy to use Computers in Student Labs as the bulletin boards. The same target can be achieved by using a Login Notice feature in Group policy but it’s not as attractive as graphical wallpapers with message which grabs the att…
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…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …

839 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