error when creating a Lnk-file shortcut over 259 symb length

Please report only one bug per message!

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
leopoldus
Senior Member
Senior Member
Posts: 221
Joined: 2004-11-21, 09:47 UTC

error when creating a Lnk-file shortcut over 259 symb length

Post by *leopoldus »

Total Commander can create (say, while copying) files with target length of full name over over 259 symbols. Than a user has a choice whether to leave the result file as is or manually reduce the name to fit it 259-symbols limitation.

However there is the only exception from this option, that it Windows shortcuts link-files (files with the extension .LNK). For some reason Total Commander does not allow to create a new shortcut in the event, that the target fullname is over 259 symbols.
The only way is to make it in the two steps. At first you should manually assign a random temporary name as say 12345.lnk to your shortcut being created. And TC has no any option to make this operation more or less conveniently, because the shortcut name is lost somewhere in the middle of the line in the proper window.
Than after the LNK-file is created, you should manually change the temporary name to what you actually need, say, to restore the original name of the file being linked to.

As there any reason for such exception? As for me, I am not able to imagine any rational foundation, so I assume it to be a bug.
umbra
Power Member
Power Member
Posts: 871
Joined: 2012-01-14, 20:41 UTC

Post by *umbra »

I can confirm, that "cm_CreateShortcut" cannot create a shortcut, when you try to save it to a very long path. After TC shows a warning about the path and one presses "Keep name", the operation fails anyway.
Windows 7 Pro x64, Windows 10 Pro x64
User avatar
leopoldus
Senior Member
Senior Member
Posts: 221
Joined: 2004-11-21, 09:47 UTC

Post by *leopoldus »

Furthermore, when creating LNK-shortcuts for multiple source files, the error described above interrupts the whole process, thus all other source files remain unhandled, even if their shortcuts' length would be under 259 symbols.
Post Reply