TC is unable to handle “reserved” filenames (CON, NUL, etc.)

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
Mormegil
Junior Member
Junior Member
Posts: 13
Joined: 2008-07-02, 18:34 UTC

TC is unable to handle “reserved” filenames (CON, NUL, etc.)

Post by *Mormegil »

Total Commander is not able to work with files using one of those “reserved” filenames. Try e.g. (with a c:\temp directory as an example)
echo test > \\.\c:\temp\nul
and then try to delete the file in TC. You’ll get “Error: c:\temp\nul cannot be deleted! Please remove the write protection!”

Total Commander should be able to delete the file using the Win32 device namespace (\\.\c:\temp\nul). Note that currently, not even lister is able to view the content of the file, but for start, it would be fine if Total Commander was able to delete (or rename) the problematic file.
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

If you create such file using \\.\ or \\?\ prefix you should delete this file yourself using same prefix. E.g. you may easilly create buttonbar button that will do it for you:

Code: Select all

Command: cmd /c del
Parameters: "\\?\%P%N"
Hint: Delete \\?\file
BTW Windows Explorer can't delete this file too. And most programs can't handle such filenames at all. I don't see any reason to use files with such names.

Similar thing was discussed some times (1, 2, ...).
Mormegil
Junior Member
Junior Member
Posts: 13
Joined: 2008-07-02, 18:34 UTC

Post by *Mormegil »

MVV wrote:If you create such file using \\.\ or \\?\ prefix you should delete this file yourself using same prefix.
Well, I didn’t. Some program creates the file from time to time in my home directory.
MVV wrote:BTW Windows Explorer can't delete this file too. And most programs can't handle such filenames at all. I don't see any reason to use files with such names.
I don’t want to “use” the file, I want to delete it. And Windows Explorer can’t do many things, that’s the reason I use (and love) Total Commander. ;-)
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Just try suggested buttonbar button. :)
User avatar
white
Power Member
Power Member
Posts: 5819
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: TC is unable to handle “reserved” filenames (CON, NUL, etc.)

Post by *white »

HISTORY.TXT wrote:01.02.22 Added: Allow to rename or permanently delete files named 'nul' by using prefix \\?\ to bypass Windows parsing of the name (32/64)
Tested OK using TC 10.50b2 32bit and 64bit.
Post Reply