File inaccessible after in-place rename (Shift+F6)
Moderators: Hacker, petermad, Stefan2, white
File inaccessible after in-place rename (Shift+F6)
I wanted to test this item in TC's history.txt:
10.11.10 Added: When renaming a file in place (Shift+F6) and the entered name is invalid, show a dialog box where the user can correct the name
So I created a small file with testfile1 filename on my NTFS volume (Windows fixed drive).
Windows XP x86 SP2 on my desktop (fsutil behavior query disable8dot3 = 0):
Shift+F6
testfile1" (double quotes character at the end of string)
Error: Cannot write E:\...\testfile1"! Please remove the write protection!
then Rename/Move to dialog
testfile1 / (space and forward slash characters)
F3 - file not found
F5 - cannot read
Shift+F6 - file can be renamed back
F6 - file moved and its filename corrected to original
F8 - file deleted to Recycle Bin, where it is listed in 8.3 format as TESTFI~1
Windows 7 x64 on my notebook (fsutil behavior query disable8dot3 = 1):
testfile1"
Error: Cannot write E:\...\testfile1"! Please remove the write protection!
NO! Rename/Move to dialog
testfile1 /
NO ACCESS !!! to the file and I cannot get rid of the file even from another Windows instance !
When doing this on ImDisk and/or TrueCrypt file container based volume (regardless of the removable flag) I cannot F3 but succeed in renaming back.
In Windows 7 x64 guest of VMware Workstation I can rename back and I also have the promised Rename/Move to dialog.
I didn't test that further. If anybody knows how to delete such a file, please help ! Thanx
10.11.10 Added: When renaming a file in place (Shift+F6) and the entered name is invalid, show a dialog box where the user can correct the name
So I created a small file with testfile1 filename on my NTFS volume (Windows fixed drive).
Windows XP x86 SP2 on my desktop (fsutil behavior query disable8dot3 = 0):
Shift+F6
testfile1" (double quotes character at the end of string)
Error: Cannot write E:\...\testfile1"! Please remove the write protection!
then Rename/Move to dialog
testfile1 / (space and forward slash characters)
F3 - file not found
F5 - cannot read
Shift+F6 - file can be renamed back
F6 - file moved and its filename corrected to original
F8 - file deleted to Recycle Bin, where it is listed in 8.3 format as TESTFI~1
Windows 7 x64 on my notebook (fsutil behavior query disable8dot3 = 1):
testfile1"
Error: Cannot write E:\...\testfile1"! Please remove the write protection!
NO! Rename/Move to dialog
testfile1 /
NO ACCESS !!! to the file and I cannot get rid of the file even from another Windows instance !
When doing this on ImDisk and/or TrueCrypt file container based volume (regardless of the removable flag) I cannot F3 but succeed in renaming back.
In Windows 7 x64 guest of VMware Workstation I can rename back and I also have the promised Rename/Move to dialog.
I didn't test that further. If anybody knows how to delete such a file, please help ! Thanx
#208434
Just a longshot - try in a dosbox: del testfile1* or del testfile*If anybody knows how to delete such a file, please help ! Thanx
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Renaming "testfile1" to "testfile1 /" in fact really renames the file to "testfile1 ". (The double quotes are only present to delimit the filename.)
This filename confirms to the Windows rules. So all Windows programmes should be able to handle the filename "testfile1 " correctly. But in fact they cannot.
Therefore trailing blanks at the end of a filename should be avoided like hell. As a consequence it would be helpful if T.C. rejected the name or at least displayed a warning that having trailing blanks can be problematic.
A simple del testfile* should be sufficient to get rid of the file as petermad suggested.
<offtopic>
The filename "testfile1 " does not cause any problems on Linux. A simple gedit "testfile1 " works perfectly and a rm "testfile1 " as well.
</offtopic>
Karl
This filename confirms to the Windows rules. So all Windows programmes should be able to handle the filename "testfile1 " correctly. But in fact they cannot.
Therefore trailing blanks at the end of a filename should be avoided like hell. As a consequence it would be helpful if T.C. rejected the name or at least displayed a warning that having trailing blanks can be problematic.
A simple del testfile* should be sufficient to get rid of the file as petermad suggested.
<offtopic>
The filename "testfile1 " does not cause any problems on Linux. A simple gedit "testfile1 " works perfectly and a rm "testfile1 " as well.

</offtopic>
Karl
- ghisler(Author)
- Site Admin
- Posts: 50532
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
TC deletes trailing spaces from names, but when the user forces such a name with a slash after the space(s), TC doesn't keep the user from doing it.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Hi, first of all, thanks for your replies.
Up to date there is only one problematic system/volume where I cannot rename/delete such a file.
Just starting to think about renaming the file by hex editor
Even from the commandline I get "The system cannot find the file specified" error.
Simply inconsistent behaviour of in-place file rename under different environments seems strange to me. I expected that TC will display "Invalid filename entered - please correct it" edit box in all cases and not write errors or silently doing no filename change.
I have found another joke: try Shift+F5 any file to "filename1 /" (without the quotes) under Windows 7. This created DIRECTORY named "filename1" for me !
Up to date there is only one problematic system/volume where I cannot rename/delete such a file.
Just starting to think about renaming the file by hex editor

Even from the commandline I get "The system cannot find the file specified" error.
Simply inconsistent behaviour of in-place file rename under different environments seems strange to me. I expected that TC will display "Invalid filename entered - please correct it" edit box in all cases and not write errors or silently doing no filename change.
I have found another joke: try Shift+F5 any file to "filename1 /" (without the quotes) under Windows 7. This created DIRECTORY named "filename1" for me !
#208434
Try to open command line and execute command:
This will rename file/folder even if its name contains trailing spaces or dot or name is special (e.g. LPT1, AUX etc). Windows functions usually trim usual filenames but never trim UNC names so you're always able to access file using \\?\ prefix.
(full path with drive letter; name exactly as file has - with spaces etc - just use cm_CopyFullNamesToClip to copy exact name and add prefix \\?\)ren "\\?\C:\Full\Path\To\File.Ext " FileNewName.Ext
This will rename file/folder even if its name contains trailing spaces or dot or name is special (e.g. LPT1, AUX etc). Windows functions usually trim usual filenames but never trim UNC names so you're always able to access file using \\?\ prefix.
- Balderstrom
- Power Member
- Posts: 2148
- Joined: 2005-10-11, 10:10 UTC
You can do similiar things with a command prompt.bfu wrote:Simply inconsistent behaviour of in-place file rename under different environments seems strange to me. I expected that TC will display "Invalid filename entered - please correct it" edit box in all cases and not write errors or silently doing no filename change.
Here's an older thread of MVV and myself (from this year):