cm_ExecuteDOS can't handle long pathname.

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
cpp64
Member
Member
Posts: 110
Joined: 2023-05-12, 16:03 UTC

cm_ExecuteDOS can't handle long pathname.

Post by *cpp64 »

# Win11-24H2
# TC11.50b2

// long pathname
"C:\123456789_123456789_123456789_123456789_123456789_\123456789_123456789_123456789_123456789_123456789_\123456789_123456789_123456789_123456789_123456789_\123456789_123456789_123456789_123456789_123456789_\123456789_123456789_123456789_123456789_123456789_\1"

cm_ExecuteDOS can't handle the long pathname.
cm_ExecuteDOS shows root of "C:\" instead of the long pathname "C:\123456789_\...".

In cmd.exe,

start cmd.exe /k cd /d "C:\123456789_123456789_123456789_123456789_123456789_\123456789_123456789_123456789_123456789_123456789_\123456789_123456789_123456789_123456789_123456789_\123456789_123456789_123456789_123456789_123456789_\123456789_123456789_123456789_123456789_123456789_\1"

works well.

------------------------------
Edit
------------------------------

Double Commander also can't handle the long pathname with cm_RunTerm.

Is this a restriction of Windows?
User avatar
white
Power Member
Power Member
Posts: 5748
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: cm_ExecuteDOS can't handle long pathname.

Post by *white »

cpp64 wrote: 2024-10-19, 04:44 UTC Is this a restriction of Windows?
Well, the same thing happens when you do it in Explorer. Open Explorer, go to the folder, press Ctrl+L (focus address field) and enter "cmd" and press Enter.
User avatar
petermad
Power Member
Power Member
Posts: 16001
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: cm_ExecuteDOS can't handle long pathname.

Post by *petermad »

It is exactly the same DOS console I see whether I use cmd.exe or cm_ExecuteDOS - and they both show "The filename or extension too long" if I execute cd /d "C:\123456789_123456789_123456789_123456789_123456789_\123456789_123456789_123456789_123456789_123456789_\123456789_123456789_123456789_123456789_123456789_\123456789_123456789_123456789_123456789_123456789_\123456789_123456789_123456789_123456789_123456789_\1" from the prompt.

If you are talking about being in folder 1\ in TC when executing cm_ExecuteDOS - you are right the console opens in C:\

cmd.exe /k cd /d "C:\12345..._\1" opens the console in the parent dir to 1\ and gives me the error message "The filename or extension too long" - both when run from TC's command line or in the DOS console.

Under Windows 7, if I am in "C:\12345..._\1" when I execute cm_ExecuteDOS nothing happens - In Windows 10 the console opens in the parent dir to "C:\12345..._\1"
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
cpp64
Member
Member
Posts: 110
Joined: 2023-05-12, 16:03 UTC

Re: cm_ExecuteDOS can't handle long pathname.

Post by *cpp64 »

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem]
"LongPathsEnabled"=dword:00000001

I enabled the long pathname before.

But the MAX_PATH restriction is still powerful.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50390
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: cm_ExecuteDOS can't handle long pathname.

Post by *ghisler(Author) »

Not a Total Commander bug - here cmd.exe just opens in c:\

Moderator message

Moved to English forum
Author of Total Commander
https://www.ghisler.com
User avatar
petermad
Power Member
Power Member
Posts: 16001
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: cm_ExecuteDOS can't handle long pathname.

Post by *petermad »

2ghisler(Author)

Maybe there is a little bug - in Windows 7 nothing happens when you are in "C:\12345..._\1"
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
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50390
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: cm_ExecuteDOS can't handle long pathname.

Post by *ghisler(Author) »

Maybe cmd.exe terminates on Windows 7 when it can't set a valid path.
Author of Total Commander
https://www.ghisler.com
User avatar
petermad
Power Member
Power Member
Posts: 16001
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: cm_ExecuteDOS can't handle long pathname.

Post by *petermad »

I just thought whether it was worth letting TC do a test of the length of the current path before executing cm_ExecuteDOS under Windows 7 ? - Personally I don't care - I never use paths that long.
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
Post Reply