PDA

View Full Version : Renaming a 144 character filename


DigitalMP
06-27-2004, 10:44 PM
I'm running 2K Pro, and I DLed an MP3 that must have been ripped with too long of a filename. I can't rename it in a DOS window either, nor can I delete it.

Does anyone have any suggestions?

Rombus
06-27-2004, 11:23 PM
cant you just rename it in windows?
if that doesn’t work, try copying the file using dos (docent 2k have tab completion?) then delete the other file.
I think the command is
copy C:/OMGLONGFILENAMEHERE.mp3 C:/OMGSHORTFILENAMEHERE.mp3

lomn75
06-28-2004, 02:10 AM
or, if that doesn't work, DOS should let you do it as copy c:\omglon~1.mp3 newname.mp3

DigitalMP
06-28-2004, 06:11 AM
I cannot delete it....Windows will not let me perform any function whatsoever upon the file because of the <128 char filename.

The DOS rename does not work either. I can't recall the error, but it's something to the effect of cannot find file, or file does not exist.

I haven't messed with it since last summer, but since I found this board, I figured someone might have a thought. I resolved a while back that I would just have to wait until a reformat, but I hate not being able to accomplish something.

arkamw
06-28-2004, 09:51 AM
I had this same problem on a relatives machine and, in DOS, it told me the file wasn't there. The file ended up being hidden. I had to modify the attributes of the file through DOS and then delete it (attrib -r -a -s -h filename.ext). Also, remember that in DOS, filenames are only 8 characters long. Thus a long file name works out to 123456~1.ext.

If that doesn't work, you can always delete the file outside of the windows environment. The repair console might let you do this or a program like BartPE should work.

You should also run a virus scan to see if there is anything there.

Cheers.

S1nF1xx
06-28-2004, 01:00 PM
Run a CHKDSK /F
It should detect and fix the long file name.

[MS]
06-28-2004, 02:01 PM
There is no 128 character limit in Windows, or the file system. Any file system you're likely using has a limit of 255.

The first thing to check would be that there weren't any error on disk. Use chkdsk as mentioned above. Second, try deleting the file agian, what is the exact error message?

Ranma_Sao
06-28-2004, 02:34 PM
It's 128. Yes command shell is stupid. You can use the 8.3 filename, and then the cmd shell will see it. Or you can try del \\?\Filename.txt

To get the 8.3 filename type dir /x
del 8.3 name

DigitalMP
06-28-2004, 03:51 PM
thank you arkamw, but the DOS shell says file not found.

I ran CHKDSK -f, and the file was unchanged. when I attempted to rename or delete it in explorer, I only am alerted by the error bell sound.

arkamw
06-28-2004, 04:48 PM
Make sure you are in the correct directory as well. You can also attrib the entire directory: attrib -r -a -s -h *.* but that might lead to files being changed that you might not necessarily want changed.

Virus check?

Cheers.

fusionrs
06-28-2004, 07:57 PM
Or grab a win98 boot disk boot to dos. Find the file and delete it :) That will work

[MS]
06-28-2004, 09:05 PM
It's 128. Yes command shell is stupid. You can use the 8.3 filename, and then the cmd shell will see it. Or you can try del \\?\Filename.txt

To get the 8.3 filename type dir /x
del 8.3 name

Windows 2000 does not have a 128 character limit on file names. For a full info on long file names, see the section "Using Long File Names" in the following link:
http://www.microsoft.com/resources/documentation/windows/2000/server/reskit/en-us/serverop/part1/sopch03.mspx

The limit is 255 characters. Sorry man ;)

Anyway, the Windows 2000 command shell (located at %systemroot%\system32\cmd.exe) has no problems with long files either. Here is a snap I just took from a win2k box of creating an deleting a file with a long name of 150 characters.
Microsoft Windows 2000 [Version 5.00.2195]
(C) Copyright 1985-2000 Microsoft Corp.

C:\Documents and Settings\richiem>copy con 123456789012345678901234567890123456789012345678901234567890 123456789012345678901234567890123456789012345678901234567890 123456789012345678901234567890.txt
this is a file with a name that is 150 characters
^Z
1 file(s) copied.

C:\Documents and Settings\richiem>dir
Volume in drive C has no label.
Volume Serial Number is 38E9-B4DC

Directory of C:\Documents and Settings\richiem

06/28/2004 05:36p <DIR> .
06/28/2004 05:36p <DIR> ..
06/28/2004 05:36p 51 12345678901234567890123456789012345678901
234567890123456789012345678901234567890123456789012345678901 23456789012345678901
23456789012345678901234567890.txt
...
...
10 File(s) 17,291 bytes
8 Dir(s) 14,179,442,688 bytes free

C:\Documents and Settings\richiem>del 123456789012345678901234567890123456789012345678901234567890 123456789012345678901234567890123456789012345678901234567890 123456789012345678901234567890.txt

C:\Documents and Settings\richiem>dir
Volume in drive C has no label.
Volume Serial Number is 38E9-B4DC

Directory of C:\Documents and Settings\richiem

06/28/2004 05:36p <DIR> .
06/28/2004 05:36p <DIR> ..
...
... 9 File(s) 17,240 bytes
8 Dir(s) 14,179,442,688 bytes free

C:\Documents and Settings\richiem>



Note that a copy of the old DOS command interpreter is also distributed with Windows 2000 as well (located at %systemroot%\system32\command.com). Normally there's no need to ever deal with it, and it's only there for compatability with very old DOS applications. To maintain backwards compatability, it's as close to the old DOS interpreter as possible, including the 127 character limit for the command line. If running from a DOS shell, you'd have problems typing in a file name that long, but you can still edit files with long names, just not directly from the command line.

The following shows creating and deleting a file with a long name in a DOS shell:
Microsoft(R) Windows DOS
(C)Copyright Microsoft Corp 1990-2001.

C:\DOCUME~1\RICHIEM>copy con test.txt
this is a file that I'll rename to a long file name. looks like the win9x legacy command.com is limited to a 128 character command string, so I'll use a batch file to accomplish this
^Z
1 file(s) copied.

C:\DOCUME~1\RICHIEM>copy con ren2long.bat
rename test.txt 123456789012345678901234567890123456789012345678901234567890 123456789012345678901234567890123456789012345678901234567890 123456789012345678901234567890.txt
^Z
1 file(s) copied.

C:\DOCUME~1\RICHIEM>ren2long.bat

C:\DOCUME~1\RICHIEM>dir
Volume in drive C has no label.
Volume Serial Number is 58C0-7D42

Directory of C:\DOCUME~1\richiem

06/28/2004 05:19 PM <DIR> .
06/28/2004 05:19 PM <DIR> ..
06/28/2004 05:18 PM 185 12345678901234567890123456789012345678901
234567890123456789012345678901234567890123456789012345678901 23456789012345678901
23456789012345678901234567890.txt
...
...
63 File(s) 2,011,964 bytes
9 Dir(s) 716,939,264 bytes free

C:\DOCUME~1\RICHIEM>del 123456~1.txt

C:\DOCUME~1\RICHIEM>dir
Volume in drive C has no label.
Volume Serial Number is 58C0-7D42

Directory of C:\DOCUME~1\richiem

06/28/2004 05:20 PM <DIR> .
06/28/2004 05:20 PM <DIR> ..
...
...
62 File(s) 2,011,779 bytes
9 Dir(s) 716,873,728 bytes free

Both of the above were from a Windows 2000 box

edit: There's some spaces that the forum is inserting into the code\quote regions.

[MS]
06-28-2004, 09:13 PM
thank you arkamw, but the DOS shell says file not found.

I ran CHKDSK -f, and the file was unchanged. when I attempted to rename or delete it in explorer, I only am alerted by the error bell sound.

Are you using the DOS Shell (command.com) or the Windows Command Shell (cmd.com)?

Unless there is a specific reason to do otherwise, use the Windows version.

I'll try and think of some other options for ya...

DigitalMP
06-28-2004, 10:37 PM
']Are you using the DOS Shell (command.com) or the Windows Command Shell (cmd.com)?

Unless there is a specific reason to do otherwise, use the Windows version.

I'll try and think of some other options for ya...

I've been using CMD, and thank you.

Everyone, thank you very much for your assistance. It's greatly apprerciated. This has been annoying me for some time, that I cannot resolve this.

arkamw
06-28-2004, 10:57 PM
The offcial stuff that MS has to say (http://support.microsoft.com/default.aspx?scid=kb;en-us;320081) about it.

Can whatever program you were using to DL (Kazaa, Morpehus, whatever) delete the file?

Can you move the folder or a parent folder to another spot in the directory tree?

Also, take a look here (http://www.purgeie.com/delinv.htm). I know nothing about this but it might work.

Running out of ideas here...

Cheers.

DigitalMP
06-28-2004, 11:39 PM
I FCUKING LOVE YOU!!!!!!! (I mean, ummmm...)

That app did it! Whoooooooooooooooooooooo!!! I didn't even mess around, and deleted the parent parent folder at first opportunity. (The only subfolder was the one containing my problem file, and nothing else).

Before, I could move the parent folder, and it's parent (the one I deleted), but could not delete them because of the 'corrupt' file.

The app did what I tried to do in DOS, reference the 8.3 filename, but for some reason I couldn't, though I checked over my syntax several times.

Thanks again!!!

David

arkamw
06-29-2004, 12:22 AM
I FCUKING LOVE YOU!!!!!!! (I mean, ummmm...)



Ummmm.... you're welcome??!

Glad it worked.

Cheers.

Ranma_Sao
06-29-2004, 02:14 PM
']Windows 2000 does not have a 128 character limit on file names. For a full info on long file names, see the section "Using Long File Names" in the following link:
http://www.microsoft.com/resources/documentation/windows/2000/server/reskit/en-us/serverop/part1/sopch03.mspx

The limit is 255 characters. Sorry man ;)



Well crud, I know theres problems with certain names above 128, since I seem to hit them all the time in my testing, and I know that copy and stuff fail on those names, that's why I suggested \\?\ syntax, but I couldn't tell you how to force it, I'll have to play with the filesystem some more when I get to work. Thanks for the link.

mechanique
07-26-2004, 12:52 PM
Had the same/similar problem DigitalMP was wrestling with; attempting to delete a file with a name well over 255 characters in length. Spent most the morning (company time, works wonders for enhancing the attention span) trying everything I and the web could think of. Your suggestion to use Delinvfile.exe worked almost immediately! So thanks both to you and to www.purgeie.com. Now I wish I knew how the program worked. I like to know what actually turns the trick.