Thursday, February 05, 2009

Dealing with 'invalid' filenames in Windows ("Cannot read from the source file or disk")

Occassionaly I run into this issue. A person has copied over a file created by a Mac onto a Windows system, due to illegal or invalid naming, the file cannot be deleted or read.

Another issue might be someone saved something and the path was too deep. Now the data is problematic - it cannot be copied from the system, deleted, renamed, whatever.

I learned something really cool today thanks to another blogger (

Please read this post:

I don't want to copy his work but I will say that you can get Windows to ignore the invalid elements by prefixing paths with \\?
For example: "\\?\C:\Documents and Settings\user\filewithdotatend."

This allows commands like C:\>ren "\\?\C:\Documents and Settings\user\filewithdotatend." "filenamewithoutdot"
Now the file is usable, deletable, whatever.

This is so cool. I had no idea. Thanks to Duncan Smart’s Weblog !

No comments:

Windows 10 with Ubuntu: Install error CanonicalGroupLimited.UbuntuonWindows cannot be found or cannot be accessed

On Windows 10 Enterprise build 1709 I installed the Windows Subsystem for Linux. Next I open the Microsoft Store and did a search for Ub...