90

I have a song that Windows can't play because there is a question mark in the name of the file.

"Where Have All the Cowboys Gone?.ogg" // as an example

So I try to rename it and Windows complains whether I try it in Explorer or from command prompt.

Error I get when trying to copy, rename, or move is:

The Filename, directory name, or volume label syntax is incorrect

Is there a Windows way to force a rename in this case?

Update

I'll keep an eye on this question, but after 13 answers and many attempts (aside form 3rd party solutions) it seems that Windows can't do this (or at least my windows can't, no short names). So I'm accepting the answer which was my original solution anyway of using Linux. It would be nice to see Windows handle this somehow, so don't stop just because I've accepted this answer, the question still stands!

9
  • 5
    May I ask how you got to this state? Windows generally won't let you do this. Aug 28, 2009 at 19:55
  • and the answer is that I got the file from a Linux box. it's actually an .ogg file too. but I was wondering since I'm at work and haven't got my linux how to do it in windows... would be nice to know
    – codeLes
    Aug 28, 2009 at 20:00
  • 7
    The filesystem NTFS allows some characters that Windows doesn't. If Windows meets such files, it b0rks. Aug 18, 2012 at 0:25
  • 1
    I once had a flashdrive go bad, chkdsk moved the files to a different sector but kept the damaged names which contained fun characters such as CRLF or even backspace. :)
    – Nulano
    Feb 9, 2017 at 15:59
  • 1
    @IvanChau: Not a duplicate. That other question is about a space in the name, which is, in fact, a piece of cake, unlike this one here (with a wildcard).
    – Sz.
    Dec 17, 2017 at 4:13

37 Answers 37

43

Grab a linux live-cd and use that.

11
  • From home I use linux anyway... and the file is on a portable hard drive, I was just wondering if Windows could handle it... something like an <b>Sudo</b> windows command or something
    – codeLes
    Aug 28, 2009 at 23:53
  • This is a wildcard issue, not a permission issue. Under linux just about everything is a valid character in a filename (including linebreaks) under Windows, there's a set of reserved characters, and no effective way to escape them. Aug 29, 2009 at 10:19
  • 4
    recent linux distros like ubuntu successfully support the most important features of NTFS. Aug 30, 2009 at 19:31
  • 1
    Ubuntu 9.04 is absolutely flawless at NTFS support, with one or two annoyances (like if there's a power cut, and you boot into ubuntu to save a few seconds boot time, you can't access your windows partition until you boot back into it)
    – Phoshi
    Sep 2, 2009 at 16:59
  • 1
    @Pacerier in theory, you possibly could, but it would mean you're mounting the drive in multiple operating systems concurrently, which is generally a bad idea. Shut down, and boot up in the new operating system. Apr 3, 2017 at 0:49
28

Have you tried using the short filenames version of its name? Eg

ren whereh~1.ogg where.ogg

If it's the only file in the current folder that starts with the first few letters, then use the first 6 letters of the name (ignoring spaces) followed by a tilde (~) then a 1.

3
  • 14
    Since generation of short names is optional depending on how Windows is currently configured, Murphy says that the OP has short names turned off and the file won't have one. To learn the short name if it is present for any file, use DIR/X which will add a column showing the short name for any file where it differs from the long name, if it has one at all. If there is a short name, this would be a plausible answer.
    – RBerteig
    Aug 28, 2009 at 22:18
  • You really should give this a try... Short filenames can sometimes be useful.
    – alex
    Aug 29, 2009 at 10:38
  • 4
    no short names, tried your example and also the dir/x proves that there aren't any listed.
    – codeLes
    Sep 2, 2009 at 15:33
24
  1. In Windows 7: Run cmd.exe in Administator Mode.
  2. cd into the Directory with the filenames.
  3. run: chkdsk /V /f [My bad files were on another drive other than the OS drive, so it was able to dismount it. If it is the OS drive, it may have to do this stage at startup.]
  4. Wait (May have to reboot).

As you will see the result was that chkdsk actually deleted the files for me. So, if you want to keep the files, I don't know what to do, but this will get rid of the files for sure.

Results/Cmd Log:

E:\islag\Music\llb>dir
 Volume in drive E is FreeAgent Drive
 Volume Serial Number is 5038-892A

 Directory of E:\islag\Music\llb

02/02/2011  12:18 PM    <DIR>          .
02/02/2011  12:18 PM    <DIR>          ..
04/04/2010  02:19 PM         4,014,099 01 Los Lonely Boys - Se?orita - www.file2
4ever.com.mp3
04/04/2010  02:18 PM         3,125,942 12 Los Lonely Boys - La Contestaci?n - ww
w.file24ever.com.mp3
               2 File(s)      7,140,041 bytes
               2 Dir(s)  87,743,991,808 bytes free

E:\islag\Music\llb>chkdsk /V
The type of the file system is NTFS.
Volume label is FreeAgent Drive.

WARNING!  F parameter not specified.
Running CHKDSK in read-only mode.

CHKDSK is verifying files (stage 1 of 3)...
  231424 file records processed.
File verification completed.
  34 large file records processed.
  0 bad file records processed.
  0 EA records processed.
  0 reparse records processed.
CHKDSK is verifying indexes (stage 2 of 3)...
18 percent complete. (29338 of 245164 index entries processed)
An invalid filename 01 Los Lonely Boys - Se?orita - www.file24ever.com.mp3 (3196
6) was found in directory 31962.
All filenames for File 31966 are invalid.
Minor file name errors were detected in file 31966.
An invalid filename 12 Los Lonely Boys - La Contestaci?n - www.file24ever.com.mp
3 (31973) was found in directory 31962.
All filenames for File 31973 are invalid.
Minor file name errors were detected in file 31973.
73 percent complete. (233817 of 245164 index entries processed)
Index entry 01 Los Lonely Boys - Se?orita - www.file24ever.com.mp3 in index $I30
 of file 31962 is incorrect.
Index entry 12 Los Lonely Boys - La Contestaci?n - www.file24ever.com.mp3 in ind
ex $I30 of file 31962 is incorrect.
  245164 index entries processed.
Index verification completed.

Errors found.  CHKDSK cannot continue in read-only mode.

E:\islag\Music\llb>dir
 Volume in drive E is FreeAgent Drive
 Volume Serial Number is 5038-892A

 Directory of E:\islag\Music\llb

02/02/2011  12:18 PM    <DIR>          .
02/02/2011  12:18 PM    <DIR>          ..
04/04/2010  02:19 PM         4,014,099 01 Los Lonely Boys - Se?orita - www.file2
4ever.com.mp3
04/04/2010  02:18 PM         3,125,942 12 Los Lonely Boys - La Contestaci?n - ww
w.file24ever.com.mp3
               2 File(s)      7,140,041 bytes
               2 Dir(s)  87,743,991,808 bytes free

E:\islag\Music\llb>chkdsk /V /f
The type of the file system is NTFS.
Cannot lock current drive.

Chkdsk cannot run because the volume is in use by another
process.  Chkdsk may run if this volume is dismounted first.
ALL OPENED HANDLES TO THIS VOLUME WOULD THEN BE INVALID.
Would you like to force a dismount on this volume? (Y/N) y
Volume dismounted.  All opened handles to this volume are now invalid.
Volume label is FreeAgent Drive.

CHKDSK is verifying files (stage 1 of 3)...
  231424 file records processed.
File verification completed.
  32 large file records processed.
  0 bad file records processed.
  0 EA records processed.
  0 reparse records processed.
CHKDSK is verifying indexes (stage 2 of 3)...
18 percent complete. (29339 of 245164 index entries processed)
Deleted invalid filename 01 Los Lonely Boys - Se?orita - www.file24ever.com.mp3
(31966) in directory 31962.
File 31966 has been orphaned since all its filenames were invalid
Windows will recover the file in the orphan recovery phase.
Correcting minor file name errors in file 31966.
Deleted invalid filename 12 Los Lonely Boys - La Contestaci?n - www.file24ever.c
om.mp3 (31973) in directory 31962.
File 31973 has been orphaned since all its filenames were invalid
Windows will recover the file in the orphan recovery phase.
Correcting minor file name errors in file 31973.
73 percent complete. (233642 of 245164 index entries processed)
Deleting index entry 01 Los Lonely Boys - Se?orita - www.file24ever.com.mp3 in i
ndex $I30 of file 31962.
Deleting index entry 12 Los Lonely Boys - La Contestaci?n - www.file24ever.com.m
p3 in index $I30 of file 31962.
  245164 index entries processed.
Index verification completed.
CHKDSK is scanning unindexed files for reconnect to their original directory.
  2 unindexed files scanned.
CHKDSK is recovering remaining unindexed files.
  2 unindexed files recovered.
CHKDSK is verifying security descriptors (stage 3 of 3)...
  231424 file SDs/SIDs processed.
Cleaning up 41 unused index entries from index $SII of file 9.
Cleaning up 41 unused index entries from index $SDH of file 9.
Cleaning up 41 unused security descriptors.
Security descriptor verification completed.
  6871 data files processed.
CHKDSK is verifying Usn Journal...
  1116928 USN bytes processed.
Usn Journal verification completed.
Correcting errors in the master file table's (MFT) BITMAP attribute.
Windows has made corrections to the file system.

 244196000 KB total disk space.
 158175168 KB in 30003 files.
     22820 KB in 6873 indexes.
         0 KB in bad sectors.
    306168 KB in use by the system.
     65536 KB occupied by the log file.
  85691844 KB available on disk.

      4096 bytes in each allocation unit.
  61049000 total allocation units on disk.
  21422961 allocation units available on disk.

E:\islag\Music\llb>dir
 Volume in drive E is FreeAgent Drive
 Volume Serial Number is 5038-892A

 Directory of E:\islag\Music\llb

02/02/2011  12:18 PM    <DIR>          .
02/02/2011  12:18 PM    <DIR>          ..
               0 File(s)              0 bytes
               2 Dir(s)  87,743,979,520 bytes free

E:\islag\Music\llb>
3
  • 1
    Worked perfectly! This should be the answer.
    – enb081
    Jun 25, 2015 at 21:37
  • 7
    @enb081 No, this shouldn't be the answer, since it doesn't have anything to do with the question, which was how to rename the files. Sheesh.
    – Jim Balter
    Feb 19, 2017 at 3:32
  • You should advise that this will remove the files before showing the steps, or some unconcious user will delete them. A friend told me. Feb 12, 2020 at 16:57
15

Try specifying the UNC path (see Naming Files, Paths, and Namespaces). This gets around all sorts of restrictions. You would do it using the \\?\ syntax.

Example, if your file was on your desktop (and your Windows drive is C:), you can do

copy "\\?\C:\Users\codeLes\Desktop\Where Have All the Cowboys Gone?.ogg" "\\?\C:\Users\codeLes\Desktop\Where Have All the Cowboys Gone.ogg"

Note: You can't use relative paths with this syntax; you must specify the full path. And it does not work with the ren command, but does work with copy and move.

4
  • 4
    gave it a try, not luck "The filename, directory name, or volume label syntax is incorrect." Thanks! I'm getting to the point where I think the correct answer is to use Linux to rename it (which I have done).
    – codeLes
    Sep 2, 2009 at 15:37
  • This answer is definitely wrong. The restriction on valid characters is in the NTFS driver in the Windows kernel. \\?\ just bypasses file path processing in the user-mode runtime library. It doesn't allow opening filenames the contain the 5 wildcard characters ( *?"<> ), other reserved characters ( /|:\ ), or control characters.
    – Eryk Sun
    Dec 25, 2016 at 23:11
  • It works in my case: I had a file name with Unicode character inside and with trailing \n . Don't ask me how do I created it (well, I'm trying to see if you can create multiple files with the identical name in Windows). Explorer, FreeCommander could not delete it but \\?\C:\... can.
    – Dio Phung
    Jun 15, 2017 at 17:49
  • I've used this way to rename files with extra spaces on the end of their names. The most common source, I've seen, of invalid file characters are from Macs using an SMB share. And from archive files (zip) created on a non windows platform. NTFS can support more characters than Windows can. So I'll have to disagree with Eryk, as the NTFS driver seems to allow these filenames to be created. Oct 31, 2020 at 3:36
13

The way i deleted the stubborn file was by opening 7zip, finding the file and renaming the file through 7zip. Mine was a song which had a space at the end of the file.

7
  • 1
    You mean the file itself wasn't even in an archive, but you just used 7-Zip to rename it on the file system? Smart.
    – Arjan
    Jan 12, 2014 at 10:44
  • 1
    This works great. I tried several of the other options here, and this was the first one that worked.
    – rakensi
    Jul 25, 2014 at 15:48
  • 2
    7zip was able to rename your file because filenames that end with spaces aren't a problem in Windows. Filenames containing '?' are a problem, and 7zip can't rename them.
    – Jim Balter
    Feb 19, 2017 at 3:42
  • This worked perfectly for me, because my problem turned out not to be actual question marks, but weird Unicode characters that just displayed as question marks in my file manager. By importing the files (there were hundreds) into a 7-Zip archive and then exporting them again, 7-Zip simply converted the bad characters to underscores (_). Then I was able to work with the files again. Problem completely solved. Thanks for an excellent tip!
    – Jesper
    May 12, 2017 at 0:37
  • I can't rename files with ":" character: i.imgur.com/dZBqqeP.png
    – user198350
    May 20, 2017 at 12:16
11

chkdsk will sometimes fix invalid file names. You will get a message about removing the file because all the file names are invalid, and then recovering a lost file. You can then find the file in C:\found.000\file0000.chk. This is an effective way to remove the problem files, but not the best way if you want to keep them.

2
  • This simple trick just helped me. I had resigned myself to losing the file after chkdsk did its work but this answer reminded me about \found.000.
    – davidbak
    Jan 29, 2019 at 7:50
  • thank you. this is simple but effective way 👍 Aug 9, 2019 at 3:48
8

Use Recuva. It is primarily intended for recovering deleted files but it also has an option for including non-deleted files in its scan.

After launching Recuva, refuse the wizard and select the right disk. Then go to Options, find and check the option "scan for non-deleted files" and launch the scan. After a while, it will show all the files on the disk (whether deleted or not). Find your files with invalid names (the names are already fixed in the view), select them, right click and save ("recover") somewhere.

enter image description here

I have just done it (on Windows XP).

1
  • Worked fine for a filename with an embedded /n which 7-zip couldn't manipulate.
    – davidbak
    Sep 7, 2019 at 22:13
6

The Microsoft tool DISKEDIT.EXE is a low-level tool for directly reading and writing raw disk data. You ought to be able to load the cluster containing the directory entry for this file and just change the offending '?' character to something innocuous and write it back to disk.

It is my understanding that the Microsoft diskedit tool (not the Norton Utilities tool by the same name, which is only for FAT volumes) was last seen in Windows 2000 SP4. But there is a link to it that can be found here.

To locate the right cluster, you can download a trial version of DiskExplorer for NTFS.

You would start with File->Drive... to open the drive containing this bad file. Select Goto->Root Directory to get a directory view. Navigate to the directory containing your bad file by using the MFT# links. When you get there, the top of the window will say something like, "MFT# x12345 DIR: 'dirname', ...blah blah blah... starting at cluster x9302AE,... blah blah blah"

Now move over to Microsoft diskedit. First do File->Open... and specify Volume Name C: (if the file is on your C: drive). Leave the Volume File Name blank. Take that starting cluster number and enter it into diskedit under Read->NTFS Clusters...->Starting Cluster (enter it as a hex number).

Now use your arrow keys to scroll down to the bad filename. It's in unicode, so you'll be looking for something like "W.h.e.r.e. .H.a.v.e. .A.l.l. .t.h.e. .C.o.w.b.o.y.s. .G.o.n.e.?...o.g.g." Position your cursor over the bad "3F" character and type something safe, like 5F ('_'). Choose Write->It to write it back to disk.

There is another spot to hit (not sure if one or both are needed). Now, back in DiskExplorer, click on the Mft# for the bad file. You'll get a screen with a tree thing on the left that says "structures". Click on "Attributes" in the tree. It will show you a list of attributes, one of which will be something like $30 ... $FILE_NAME. So, $30 has the file name. Click on the Body node under the $30 node in the Structures tree. Select menu View->as Hex. Several lines down, you should see the filename again W.h.e.r.e. .H.a.v.e... etc. Over on the left side of the screen, you'll see the Sector column, which shows which disk sector you're looking at.

Back over the diskedit. Do Read->Sectors... and enter the sector number from DiskExplorer. As before, scroll down and replace the "3F" character with the same character as you did above. Choose Write->It to write it to disk.

I did all this, and the tools tell me that I've changed the character, but explorer doesn't. The directory must be cached somewhere. After a reboot, the change becomes visible.

1
  • +1 for the correct (but more or less impractical) approach, hoping it'll bubble up a bit and overtake at least some of the wrong answers. ;)
    – Sz.
    Dec 17, 2017 at 4:01
5

If you have Cygwin installed it should be able to take care of the file. I had that problem just now and using rm from Cygwin in a bash shell was able to delete the file just fine when no Windows app, including Explorer and including trying to use the UNC filespec with CMD.exe helped.

I would imagine that mv would do it to in case you wanted to keep the file.

A barebones Cygwin setup only takes a few minutes, and I always keep it around anyway because there are so many good tools. It's easier than booting Linux, even using a live CD.

5
  • I tried, cygwin wasn't able to delete the file ('No such file or directory'). Good idea though.
    – JulianHzg
    Mar 1, 2014 at 13:54
  • 1
    This worked for me, or using the similar MSYS2 (a rewrite of MSYS, a fork of Cygwin) on Windows 8.1. I was able to mv the file to a new name and then delete it normally. My file had a space at the end, and it showed up using 'dir' - 'ls' didn't show it though. Mar 3, 2015 at 8:23
  • @bburns.km, at least you qualified your "works for me" statement. Of course it works for a filename with just a space at the end. \\?\ would also work in this case -- when used properly with a Unicode, fully-qualified path. It's bypassing the user-mode runtime library code that emulates some quirky old MS-DOS rule from the 80s that ignores spaces at the end of names. The problem with invalid and reserved characters can't be addressed like this.
    – Eryk Sun
    Dec 25, 2016 at 23:24
  • FWIW this is the only solution that worked (easily) for me. I don't have admin rights on this PC so installing anything or using anything requiring admin privileges was not possible and I needed to remove a leftover file named con. I had MSYS2 on my machine and I could simply rm it.
    – SolarBear
    Nov 20, 2020 at 14:04
  • No, this does not work for file containing a : character. It says mv: cannot stat 'Screenshot from 2015-10-11 21:29:26.png': No such file or directory
    – Bastian
    Nov 22, 2020 at 15:44
4

Have you tried moving it to a file with the right name?

move "Where Have All the Cowboys Gone?.mp3" "Where Have All the Cowboys Gone.mp3"
5
  • 2
    tried, no luck. "The Filename, directory name, or volume label syntax is incorrect"
    – codeLes
    Aug 28, 2009 at 19:51
  • It worked for me with the copy command.
    – Nicolas
    May 6, 2013 at 7:10
  • @Nicolas, you mean there was a ? or * or < or > or : in the name, and copy-ing just worked? (I just tried it and it didn't for me, unsurprisingly.)
    – Sz.
    Dec 17, 2017 at 4:08
  • @Sz. sorry to heard it didn't work for you. I don't remember the filename I had to rename, but it worked for me with the copy command. Did you also try cygwin and the bash command mv?
    – Nicolas
    Dec 20, 2017 at 9:44
  • 1
    @Nicolas, thanks for trying to help, but my point is that those chars I listed above (and a few others, like ", |, /, and of course the backslash (which I can't seem to enter here :) )) are in a different class of problematic chars (reserved), and I'm afraid, neither the copy command nor Cygwin can get round to renaming them. (You most likely had some different chars in your problematic filename.)
    – Sz.
    Dec 20, 2017 at 13:28
4

Try using a third party tool such as the Ken Rename tool:

Screenshot of Ken Rename

or Rename Master.

enter image description here

Here's a list of file renaming tools.

I'd test them myself, but I'm running Windows Vista 64-bit; the file handling may be different.

If those tools fail, you may want to give Windows PowerShell a shot. See Renaming Files on the Windows PowerShell Blog.

2
  • I tried Directory Opus, and it didn't work (same error message).
    – user14068
    Nov 5, 2009 at 14:05
  • I tried Flexible Renamer 8.4 which seems to do the trick. Sourced from the same website you mentioned. Nov 29, 2014 at 10:41
4
  • If it's more than 1 file, create new directory with a simple name, for example a.
  • Move one single file each time to that directory.
  • In cmd.exe go to the new directory and type the following:

    ren *.ogg 1.ogg   
    

    This is for simplicity. Then you can rename it in XP as you want, like 1.ogg to Where Have All the Cowboys Gone.ogg. ogg was just an example, extension can be anything.

1
  • 1
    Huh? How are you supposed to move that file (of OP) with the wildcard in its name?
    – Sz.
    Dec 17, 2017 at 4:05
3

Assuming the volume in question is FAT32 or NTFS, try running chkdsk. That should clean up 'corrupted' directory entries, which would (in this case) mean removing the ?. If it's the boot volume, you might need a reboot to do it.

2
  • I had a folder name with a : and doing this made the directory disappear. DON'T do this.
    – leeand00
    May 12, 2017 at 12:08
  • 1
    Actually, chkdsk moved the contents of the folder in the root directory of the hdd to a hidden folder and I was able to get my files back there see: superuser.com/a/320654/2293
    – leeand00
    May 12, 2017 at 12:31
3

This should work (at least, it did for me):

dir /X *cowboys*

That command would output somethig similar to this:

08/11/2011  15:21    <DIR>          WH5E97~1     Where Have All the Cowboys Gone
?.ogg

That WH5E97~1 is what you're looking for!
(Plase notice: such code is totally invented, but should be similar to the one you'll find)

Knowing that, a simple

rename WH5E97~1 "Where Have All the Cowboys Gone.ogg"

should do the trick.

Hope it helps.

2
  • Nice solution. Should work, but only works if the filename is longer than 8 characters (therefore not in my case).
    – JulianHzg
    Mar 1, 2014 at 13:58
  • Not necessarily. According to the documentation typing dir t97* returns both files, because the asterisk wildcard matches the file t.txt2 to t97.txt by using its short name map T97B4~1.TXT Aug 18, 2014 at 12:08
2

have you tried:

type "Where*.ogg" > "Where.ogg"

might work.

1
  • 2
    The filename, directory name, or volume label syntax is incorrect.
    – Ciaran
    Aug 28, 2009 at 23:23
1

Try a wildcard on the move -

move "Where Have All the Cowboys Gone*.mp3" "Where.mp3"

That's probably your best bet, as long as there is only one file that matches the wildcard.

2
  • Actually, in this case, it should already work with the filename as is since the question-mark is a wildcard. No need for the asterisk this time.
    – Synetech
    Aug 20, 2013 at 14:53
  • 2
    Sadly, that doesn't work, either with the original filename or with a more general wildcard like *.mp3.
    – JulianHzg
    Mar 1, 2014 at 13:56
1

drag and drop to a new folder, navigate in command prompt to that folder and type

ren *.* test.ogg
2
  • 1
    dragging and dropping fails too with the same error... thanks though
    – codeLes
    Aug 28, 2009 at 20:01
  • 6
    Conversely you could try moving everything else out of the folder in question. Sep 2, 2009 at 16:58
1

Try cygwin to rename the file:

the command would be: mv filename?.ogg filename.ogg

2
  • i tried cygwin once on Vista, seemed to have the same issue, don't have access to it on my current work machine...
    – codeLes
    Sep 2, 2009 at 17:11
  • doesn't work, tried on Win7 64b
    – Max
    Jan 19, 2015 at 19:33
1

Most Microsoft internal commands are controlled with the presence of explorer.exe.

Open your Task Manager and examine the list of current active processes. You will find explorer.exe among them. Right-click and terminate/stop/close explorer.exe. Do not close the Task Manager yet. Now, go to the offensive file using a secondary file-manager and try deleting or renaming with wildcards. It will probably be successful.

Now, return to the Task Manager window and right-click top line saying Applications, then choose bottom button saying New Task. Enter explorer.exe. Explorer shows up again and the offensive file is no longer there.

1

The WinRAR GUI will allow you to rename the files without even having to pack them into an archive first. I've tested it in Windows 8.1, on a very long file name. Worked like a charm.

0
1

If you have WinRAR, pack it on WinRAR, rename it on WinRAR, unpack it.

Or you can try with a VBScript, take next script and save it under a file with .vbs extension.

Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")

fso.MoveFile "Where Have All the Cowboys Gone?.ogg", "Where.ogg"
5
  • 2
    I don't have WinRAR at work and my work machine is not on the net. I do have 7zip, anyway I can do that with 7zip, just tried and it wouldn't let me add it to the archive... same error :-)
    – codeLes
    Aug 28, 2009 at 19:58
  • tryijng your script nets me a "path not found" error (code: 800A004C). does it matter that this file is on an external USB drive? I put the file in the same folder... will try to hard code the entire file location next
    – codeLes
    Aug 28, 2009 at 20:12
  • fully qualified name no work either...
    – codeLes
    Aug 28, 2009 at 20:13
  • i agree up on the chkdsk option Aug 28, 2009 at 20:18
  • Tried it with WinRAR. Didn't work. Same result.
    – user14068
    Nov 5, 2009 at 14:12
1

This is not a direct answer (as in how can Windows rename a file) but this works for me. The illegal files are usually on an external drive so I connect the external drive to my Android tablet. This allows me to rename the file which can then be read by Windows. This deals with special chars but the usual problem I get is a file name starting or ending with a space or ending with a '.'

I tried one of the 3rd party tools FlexRenamer but this still struggles with the above.

1
  • Worked great. I'd guess this would work with an iPhone also. Jan 27, 2021 at 13:03
1

I've also had a similar problem with a folder. The folder name was ".min." which is normally not allowed.

Rename Not Allowed (click for image)

Using Winrar I was able to solve this. What i did was

  • right click on the folder
  • select 'Add to archive...'
  • select a new archive name (one with no special characters)
  • from the archiving options select 'Delete files after archiving'
  • than select OK

Add To Archive... (click for image)

  • I then opened the .rar file
  • and renamed the file within

This is allowed since windows does not really check what is inside of the .rar file. As soon as you change the name then extract the file and you are done.

I hope this helps.

1
  • Doesn't work for me. My filename is 10:2.
    – Pacerier
    Mar 11, 2017 at 11:12
1

Special characters don't work with ren; escape the problem character with move:

move "Where Have All the Cowboys Gone^?.ogg" "Where Have All the Cowboys Gone.ogg"

Tested in Win 10 with ? & %

0

Use cmd.exe in this directory with wildcards. For example:

ren "Where Have All the *.ogg" "Where Have All the Cowboys Gone.ogg"
2
  • Globbing is done by the shell.
    – Hello71
    Mar 22, 2011 at 21:29
  • 3
    @Hello71: Not in a DOS box, Linux boy.
    – harrymc
    Mar 22, 2011 at 21:47
0

7-Zip file manager (7-zip.org) will rename files and directories that XP cannot. Just used it to extract a .tar file and rename the enclosed, illegally named .chm file. No LiveCD required.

Tschüß!

0

I had a similar problem with 2 nested folders with subfolders. I couldn't neither rename nor delete some of the files (I tried many ways). At last, I found the solution: Teracopy.

Install it, right click the folder or file and select teracopy. Teracopy will open, then just click delete or rename. It will rename or delete it.

You might want to give it a try.

0

I've bumped into the same situation.

Googling around I learnt there is no native solution.

... and I use as a shell the JPSoft's TCC, which also could not handle those darned files.

But, I also learnt that Cedrick Collomb's Unlocker (http://www.emptyloop.com/unlocker/) is able to handle'm.

And I had it in my setup. Also, I highly recommend it.

Well, at least this solution does not involve leaving windows environment...

0

I fixed a FLAC file like this by using Winamp's basic open command, using that program explorer window. When I went to the folder, I had the rename option, unlike Explorer.

0

I came across a similar situation. None of the posted solutions worked for me but I finally found an easy solution:

  • No external tool needed
  • No knowledge of any programming or shell scripting language needed

I simply copied the file (yes, copying was still possible for me) to a USB stick, renamed it there and placed it back again! I leave it to others to explain why that worked.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .