As the script requires the long name it's causing issues.
If you have Python to see what I mean try:
Create this Python file and add it as a button then drop any file on it.
Code: Select all
# test,py
import sys
print(sys.argv[1])
input()
Moderators: Hacker, petermad, Stefan2, white
Code: Select all
# test,py
import sys
print(sys.argv[1])
input()
Code: Select all
C:\Program Files (x86)\Total Commander\history.txt
Code: Select all
C:\program~2\totalc~1\history.txt
Code: Select all
:: test.bat
@echo off
my_python_script.py %1
It says it only passes the long name if the program isn't a 16-bit program. It seems to default to short names for .exe files and to only use long names when TC can determine that the program is not a 16-bit program.HISTORY.TXT wrote: 26.01.07 Added: Button bar: When dropping a file to a program on the button bar, pass the long name instead of the short DOS name to the program (in double quotes "" if needed) if the program isn't an old 16-bit program. If this causes problems, put %p%n in the parameters field of the button
Code: Select all
TOTALCMD#BAR#DATA
cmd.exe /k echo
cmd.exe
0
-1
Code: Select all
TOTALCMD#BAR#DATA
C:\WINDOWS\system32\cmd.exe /k echo
cmd.exe
0
-1
Since the intention is to support 16-bit programs, it makes no sense for 64-bit TC and for 32-bit TC running on 64-bit Windows. So the code can be removed from 64-bit TC, and 32-bit TC can be modified so that it does not attempt to support 16-bit programs when running on 64-bit Windows. That way you keep maximum compatibility, while also phasing out this feature.Dalai wrote: 2024-12-29, 16:31 UTC IMO it would be better for the 16-but compatibility thing to work the other way around: use only short names if the executable is detected as 16-bit, and use long names in all other cases. Long names have existed for decades and MS is moving towards disabling short names by default.
Tested OK using TC 32-bit and 64-bit on my 64-bit system and confirmed unchanged behavior when using TC 32-bit on a virtual machine with 32-bit Windows.HISTORY.TXT wrote: 07.01.25 Fixed: On 64-bit Windows, always assume that called programs can handle long file names (don't check whether the target program is 16-bit), e.g. when dropping a file to a button (32/64)
Thank you developersHISTORY.TXT wrote: 07.01.25 Fixed: On 64-bit Windows
I agree that a modern TC should pass a short path only under 32-bit Windows and only when 16-bit program is detected, in any other case it should pass a long path. Or maybe an INI option may be added with e.g. 0 (always short), -1 (auto) and 1 (always long) choices. But I would like to disable all long-to-short translations in TC and always use only long paths everywhere, so maybe such an option may be for multiple actions that still convert long paths to short ones.white wrote: 2024-12-29, 17:07 UTC Since the intention is to support 16-bit programs, it makes no sense for 64-bit TC and for 32-bit TC running on 64-bit Windows. So the code can be removed from 64-bit TC, and 32-bit TC can be modified so that it does not attempt to support 16-bit programs when running on 64-bit Windows. That way you keep maximum compatibility, while also phasing out this feature.