Rename: TC cannot change the letter case of file/dir if need elevation

The behaviour described in the bug report is either by design, or would be far too complex/time-consuming to be changed

Moderators: white, Hacker, petermad, Stefan2

Post Reply
Slavic
Senior Member
Senior Member
Posts: 290
Joined: 2006-02-26, 15:41 UTC
Location: Montenegro

Rename: TC cannot change the letter case of file/dir if need elevation

Post by *Slavic »

This problem may have a long story, but it happens not often in practice and so may be forgotten.
If we want to rename a file or folder which requires admin (elevated) rights, after input a new name usually TC shows a warning message; we can choose "As Administrator" option, sometimes need to confirm this in UAC dialog, and the object will be renamed. However, if we use rename operation to change only the letter case of the object, TC refuses to perform this operation and keeps the old name. Explorer, on the other side, does this correctly.

How to reproduce:
For simplicity, we can use the C:\Program Files (x86) dir, which doesn't allow to create or rename anything without admin rights.
1. Create a new folder C:\Program Files (x86)\MyFolder in TC. Choose As Administrator, and it will be created.
2. Try to rename it in place (Shift+F6) to myfolder. TC will keep the original name.
3. Open the Explorer locally (right click on parent "..", choose first line in context menu). Then use F2 or Rename in context menu on MyFolder, input myfolder. Explorer will show the dialog informing about administrator rights, choose Continue. Renamed successfully!

Possible reason: TC attempts to rename an object (it fails because of lack of rights) and then checks the result using case-insensitive comparison. It counts that MyFolder and myfolder are the same, so no need to ask admin rights and rename. But if comparison shows the difference (e.g. MyFolder -> myfodder), it asks for admin rights and works as expected. If rename does not require admin rights, changing the letter case works correctly.
Desktop: Windows 11 Pro 23H2, TC 11.03(RC). Mobile: Pixel 5a, Android 14, TC 3.42b5
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Rename: TC cannot change the letter case of file/dir if need elevation

Post by *petermad »

Confirmed.

Workaround: rename to something else like myfolder1 first and then to myfolder
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Rename: TC cannot change the letter case of file/dir if need elevation

Post by *ghisler(Author) »

checks the result using case-insensitive comparison
That's exactly what I do, because some file systems like FAT32 do not support case sensitive renaming. Therefore I will not change this behaviour, sorry.
Author of Total Commander
https://www.ghisler.com
Slavic
Senior Member
Senior Member
Posts: 290
Joined: 2006-02-26, 15:41 UTC
Location: Montenegro

Re: Rename: TC cannot change the letter case of file/dir if need elevation

Post by *Slavic »

ghisler(Author) wrote: 2022-01-10, 11:08 UTC That's exactly what I do, because some file systems like FAT32 do not support case sensitive renaming. Therefore I will not change this behaviour, sorry.
Sorry, but if this a fundamental design decision (whether users agree or not), then the current ability of case-sensitive renaming without elevation should be counted as a bug :(
Desktop: Windows 11 Pro 23H2, TC 11.03(RC). Mobile: Pixel 5a, Android 14, TC 3.42b5
Post Reply