Renaming/Deleting files with long file names

  • Thread starter Thread starter Industrial One
  • Start date Start date
I

Industrial One

File names so long that Windows XP SP2 does not let me do shit. I
can't delete. I can't double-click to rename because nothing happens,
I can't right click because no context menu pops up, well it does but
only a few, basic buttons and none of them do anything anyway. Del or
Rem via CMD didn't work, Unlocker didn't work (if I right-click,
nothing happens, remember?)

What's a guy to do?
 
File names so long that Windows XP SP2 does not let me do shit. I
can't delete. I can't double-click to rename because nothing happens,
I can't right click because no context menu pops up, well it does but
only a few, basic buttons and none of them do anything anyway. Del or
Rem via CMD didn't work, Unlocker didn't work (if I right-click,
nothing happens, remember?)

What's a guy to do?

How long is the file name? How did you manage to create such a long
name?

Some suggestions using a command session:

- use wildcards. IOW, if it's called
MuchMuchMuchMuchMuchMuchMuchMuchMuchMuchTooLong.fil , do the command
REN *.fil ShortName.fil . This might affect other files in the folder,
so be careful.

- the long file name includes the path as well, so move the file to a
folder closer to the root, then try your rename.

- find the short name by issuing the command DIR /X. Then try your
operation on the short name.

- if the folder where the long-named file lives is itself expendable,
move all other files out of it and, from the parent folder, remove the
directory with the /S argument, a la: RMDIR /S BadFolder . This will
remove the folder and all files within it.
 
How long is the file name? How did you manage to create such a long
name?

Some suggestions using a command session:

- use wildcards. IOW, if it's called
MuchMuchMuchMuchMuchMuchMuchMuchMuchMuchTooLong.fil , do the command
REN *.fil ShortName.fil . This might affect other files in the folder,
so be careful.

I haven't been following this thread, but the way to be careful is to
include the switch /p which will prompt you with the name of each
file to be renamed and you can answer y or n. When you have passed
all the files you want to rename, you can cntl-C, which will go back
to the prompt.
 
I downloaded an MP3 from Limewire, which in typical bullshit fashion
has to have EVERYTHING IMAGINEABLE ****ING TAG in the filename. E.g.
DJ PULSE - Euphoria (Trance, Dance, Techno, Rave, 2007, DJ Hixxy, DJ
Tempo, Acid, Happy Hardcore).MP3

I don't know how long the filename is but I reckon longer than 255
chars if it's bugging up Windows.

I would use a wildcard but all I have are MP3 files in this folder and
I really do not wanna risk affecting another one. Is there any simple
tool out there, is there a way I can change the filename by editting
the MFT? I have searched the web all over the place for this long-
filename problem and it amazes me how this can be such a complicated
issue that makes everyone act like an ignorant tard whenever someone
brings it up. What's the deal?
 
I would use a wildcard but all I have are MP3 files in this folder
and I really do not wanna risk affecting another one. Is there any
simple tool out there, is there a way I can change the filename by
editting the MFT? I have searched the web all over the place for
this long- filename problem and it amazes me how this can be such
a complicated issue that makes everyone act like an ignorant tard
whenever someone brings it up. What's the deal?

Just move everything else out of the folder temporarily. Then perform
your surgery. Then move everything back into place. Easy peasy.

Since you are calling the people who are trying to help you "tards"
this is my last suggestion. Good luck. You will need it with that
attitude.
 
Just move everything else out of the folder temporarily. Then perform
your surgery. Then move everything back into place. Easy peasy.

Tried that, "The system cannot find the file specified" 7x for 7 files
that matched the wildcard, all having long enough filenames to bug out
Windows.
Since you are calling the people who are trying to help you "tards"
this is my last suggestion. Good luck. You will need it with that
attitude.

I didn't call anyone here a tard, I said "makes people act like
ignorant tards." I was referring to the places I already searched on.
I wouldn't be here if any of them were in the business of credibility.
Ironic thing is, some of them even had populations of real, employed
tech support people and self-proclaimed experts, all who drool on the
floor whenever this issue is brought up, as if it's rocket science.
I don't know man. I don't know.
 
I didn't call anyone here a tard, I said "makes people act like
ignorant tards." I was referring to the places I already searched
on. I wouldn't be here if any of them were in the business of
credibility. Ironic thing is, some of them even had populations of
real, employed tech support people and self-proclaimed experts,
all who drool on the floor whenever this issue is brought up, as
if it's rocket science. I don't know man. I don't know.

Well, I do know. You got yourself into an unfortunate situation, and
you have to take some extra effort to get out of it. There's not
necessarily any one best solution. I've already given you several ways
to do it. Whether you like it or not, the ball's now in your court.
 
Well, I do know. You got yourself into an unfortunate situation, and
you have to take some extra effort to get out of it. There's not
necessarily any one best solution. I've already given you several ways
to do it. Whether you like it or not, the ball's now in your court.

Alright, let's review them:

- use wildcards. IOW, if it's called
MuchMuchMuchMuchMuchMuchMuchMuchMuchMuchTooLong.fil , do the command
REN *.fil ShortName.fil . This might affect other files in the folder,
so be careful.

Didn't work, as explained in last post.

- the long file name includes the path as well, so move the file to a
folder closer to the root, then try your rename.

I can't move the file, I can't right-click, I can't manipulate it in
any way. I can't even open it.

- find the short name by issuing the command DIR /X. Then try your
operation on the short name.

This works (thank god) for deleting, but not renaming. While I have an
ingenious way of accessing the file thru other means (opening the
entire hard disk with a hex editor and copying the bits directly into
a new file) it would be more convenient if I could rename it via CMD
the same way I can delete.
 
Industrial One said:
Alright, let's review them:

- use wildcards. IOW, if it's called
MuchMuchMuchMuchMuchMuchMuchMuchMuchMuchTooLong.fil , do the command
REN *.fil ShortName.fil . This might affect other files in the
folder,
so be careful.

Didn't work, as explained in last post.

- the long file name includes the path as well, so move the file to
a
folder closer to the root, then try your rename.

I can't move the file, I can't right-click, I can't manipulate it in
any way. I can't even open it.

- find the short name by issuing the command DIR /X. Then try your
operation on the short name.

This works (thank god) for deleting, but not renaming. While I have
an
ingenious way of accessing the file thru other means (opening the
entire hard disk with a hex editor and copying the bits directly
into
a new file) it would be more convenient if I could rename it via CMD
the same way I can delete.

A variation on the approach that suggests moving the file to a shorter
path is to use SUBST to shorten the path without moving the file.
That might shorten things to where you can rename the file. Syntax is
SUBST Z: C:\path\to\file\you\want\to\rename - use whatever drive
letter you like in place of Z:, and you may need to enclose the
C:\path... in quotes if it contains spaces. Once you've done that,
then just go to the file in the new drive letter and try the rename.

Hope this helps.
 
I downloaded an MP3 from Limewire, which in typical bullshit fashion
has to have EVERYTHING IMAGINEABLE ****ING TAG in the filename. E.g.
DJ PULSE - Euphoria (Trance, Dance, Techno, Rave, 2007, DJ Hixxy, DJ
Tempo, Acid, Happy Hardcore).MP3

I don't know how long the filename is but I reckon longer than 255
chars if it's bugging up Windows.

I would use a wildcard but all I have are MP3 files in this folder and
I really do not wanna risk affecting another one. Is there any simple
tool out there, is there a way I can change the filename by editting
the MFT? I have searched the web all over the place for this long-
filename problem and it amazes me how this can be such a complicated
issue that makes everyone act like an ignorant tard whenever someone
brings it up. What's the deal?

If you want any more help from me, eliminate the vulgar words and the
insult.

Yes, whether you intended to or not, you were referring to me and Nil
because we are two of the ones replied after you brought it up, and
you said "everyone".
 
File names so long that Windows XP SP2 does not let me do shit. I
can't delete. I can't double-click to rename because nothing happens,
I can't right click because no context menu pops up, well it does but
only a few, basic buttons and none of them do anything anyway. Del or
Rem via CMD didn't work, Unlocker didn't work (if I right-click,
nothing happens, remember?)

What's a guy to do?
http://support.microsoft.com/kb/320081
Hope this will be of some help.
 
tommyold said:

Mapping the folder containing the file, is also suggested as a
solution at the end of this thread.

http://www.tomshardware.com/forum/198314-46-deleting-file-path-long

"Map a drive letter to any folder deep within your directory tree.
This replaces, for example,

"\\obrtw23\Business\BusinessPlanning\2009Plans\PurchasingPlan" with "L:\".

You do this by right-clicking on "My computer" and selecting
"Map network drive" . Whatever you put in for the path, that
will be equivalent to the new drive letter. Just keep the
mapped path short enough to work."

If the long file name, was at the root level of the drive, that
isn't going to work. But if the file is a bit deeper, perhaps
you can get around the "shell" versus "file system" differences
enough, to rename it.

HTH,
Paul
 
Bob said:

I also did a test with Perl scripting, and was
able to create a 259 character long file name, which
I couldn't delete from explorer. (I could delete a 258
character fule file/path name, but not 259.)

Perl has a rename function, and using that function,
I could change the name of the 259 character file to
something shorter, after which the test file I created
could be deleted.

I got my copy of Perl here.

http://downloads.activestate.com/Ac...ActivePerl-5.12.2.1202-MSWin32-x86-293621.msi

This is the contents of my rename.pl file. This is just
to test out a few ideas in Perl.

When Perl is installed, programs ending in .pl are
executable from the Command Prompt window. Opening
a command prompt, and cd'ing to the test directory,
I could run a script like this. This is my prototype,
which takes no arguments, because I'm hard-coding any
file names I want to test with.

************************************** rename.pl ****************
printf("this is a test\n");

# http://www.tutorialspoint.com/perl/perl_files.htm

#rename("one", "two"); I tested a basic rename would work and it did.

# This chunk creates a long file name. The concatenated string is
# a short hand form, to save typing. The $b string variable, holds
# a less than ten character string, so you can find out exactly how
# many characters the file system will take. The "open" command tries
# to create a file, and if the create operation fails, the program
# exits.

$a = "0123456789";

$b = $a.$a.$a.$a.$a.$a.$a.$a.$a.$a.$a.$a.$a.$a.$a.$a.$a.$a.$a.$a.$a.$a.$a ;
$b = $b . "0123456.txt" ;

open(OUT, ">>$b") || die("Cannot create file");
close(OUT);

# On my Win2K virtualpc test OS, I could get a total 259 character
# path/filename.

# This prints out the filename. I'm working relative to the
# current working directory, so I glue the working directory name
# to the filename I'm using.

use Cwd;

$c = getcwd ;

printf("%s/%s\n", $c , $b );

$c = $c . "/" . $b ;

printf("Length of full file path is %d\n", length $c );

# When the file can no longer be erased, I uncomment this
# line and it renames the long filename, back to a ten character
# file name, for easy deleting in Explorer. If I run the script
# as is, the file name ends up as "0123456789". Place the # in
# front of this line, to see the 259 character filename in the folder.

rename( $b , $a );

exit(0);
***************************************************************

Anyway, if the original poster gets bored, it's possible a
scripting language may provide a good enough compromise
between programming skills and flexibility, to do a rename
operation. If you had only one file to fix, the filenames
could be hard coded in the script and then run. I don't know
enough Perl to do that. The only reason I used Perl, is I bought
two Perl books about ten years ago - and now I got my money's
worth.

The thing is, I don't know what tool is the "most powerful" at
fixing this problem. If Windows had two ways to refer to a file
like in a Unix environment (inode and file name), you might have
more options to fix this problem. As far as I know, all Windows
has is the file name. (I figured booting a Linux LiveCD and
working the problem, would be cheating.)

Paul
 
Sir, the way you explain this may not be clear to some people. Here is a
better way of explaining this operation (of deleting files with
extraordinary long names that are normally undeletable) to everybody, even
to fools like me...

1- Go to the Command Mode (that is to say the good old DOS prompt, you know
the one with the black screen!) and once there...

2- Key in(without the quotes of course) " cd \ " (if you need to go to the
root folder for example or otherwise for example just key in...
" cd My Documents " and press ENTER, OR having changed to the root directory
key in whatever pathname is relevant for the folder where the relevant file
is situated and press ENTER

3- Once in that folder, key in " del " (without the quotes obviously)
followed by the first six letters of the filename followed by a tilde and 1
(that is number one) followed by the relevant filename extension such as
..txt for example as you can see in the example below...

del garbag~1.txt

and press ENTER.

And Bob's your uncle! The job is done. You have deleted the file!

Good old DOS commands! You still can't beat them even in this day and
age!!!!!
 
in command mode use the first 6 characters plus a tilde plus a 1
then the extension.

if you have multiple files starting with the same first 6
characters then it is file names 6+!+2 through 9. Don't know
about numbers past that.

There's no need to guess what the short name of the file is.
DIR /X will tell you for sure.
 
Industrial One said:
File names so long that Windows XP SP2 does not let me do shit. I
can't delete. I can't double-click to rename because nothing happens,
I can't right click because no context menu pops up, well it does but
only a few, basic buttons and none of them do anything anyway. Del or
Rem via CMD didn't work, Unlocker didn't work (if I right-click,
nothing happens, remember?)

What's a guy to do?

Simply use XYplorer file manager: it can handle overlong (> 260 chars) file
names straight from the GUI.

http://www.xyplorer.com/

Don
 
Industrial said:
I downloaded an MP3 from Limewire, which in typical bullshit fashion
has to have EVERYTHING IMAGINEABLE ****ING TAG in the filename. E.g.
DJ PULSE - Euphoria (Trance, Dance, Techno, Rave, 2007, DJ Hixxy, DJ
Tempo, Acid, Happy Hardcore).MP3

I don't know how long the filename is but I reckon longer than 255
chars if it's bugging up Windows.

I would use a wildcard but all I have are MP3 files in this folder and
I really do not wanna risk affecting another one. Is there any simple
tool out there, is there a way I can change the filename by editting
the MFT? I have searched the web all over the place for this long-
filename problem and it amazes me how this can be such a complicated
issue that makes everyone act like an ignorant tard whenever someone
brings it up. What's the deal?

Can't the file be renamed from within the Limewire software?

If not, if the software writes out these sort of filenames to
your filesystem without sanity-checking them, it seems to be a
bug in the software that should be reported to the developer.


--
 
Back
Top