passing a very long filename to internal association program
Moderators: Hacker, petermad, Stefan2, white
passing a very long filename to internal association program
Hi there,
I have set up various internal command entries for .mp3.
I noticed that there seems to be a problem if the filename and path is longer, e.g. 275.
Is there a setting where I can change this behaviour or is it a limitation?
You can easily reproduce this by setting up: notepad "%1".
thx
I have set up various internal command entries for .mp3.
I noticed that there seems to be a problem if the filename and path is longer, e.g. 275.
Is there a setting where I can change this behaviour or is it a limitation?
You can easily reproduce this by setting up: notepad "%1".
thx
Are you sure that programs that you're using support long paths?
As for me, Notepad isn't able to open files with long paths so it is not a TC problem. Wordpad seems to be able to open such file via context menu "Open with - Wordpad" but strangely closes when I try to open it via command line. Very same behaviour I see using Windows command line.
As I see, TC passes correct path to editor. But special handling is required for files with long paths (longer than 259 characters) so only few programs support such paths.
As for me, Notepad isn't able to open files with long paths so it is not a TC problem. Wordpad seems to be able to open such file via context menu "Open with - Wordpad" but strangely closes when I try to open it via command line. Very same behaviour I see using Windows command line.
Code: Select all
C:\>write F:\Temp\12345678901234567890123456789012345678901234567890123456789012
34567890123456789012345678901234567890\12345678901234567890123456789012345678901
23456789012345678901234567890123456789012345678901234567890\12345678901234567890
12345678901234567890123456789012345678901234567890123456789012345678901234567890
\1.txt
As I see, TC passes correct path to editor. But special handling is required for files with long paths (longer than 259 characters) so only few programs support such paths.
Hmm ok I didn't think about the program.
Actually it is winamp I have the problem with.
If I drag and drop a file from the long path to winamp it works.
If I use the internal association (winamp /ADD "%1") it does not.
Maybe the problem lies within winamp, I will try to get more information on that.
Actually it is winamp I have the problem with.
If I drag and drop a file from the long path to winamp it works.
If I use the internal association (winamp /ADD "%1") it does not.
Maybe the problem lies within winamp, I will try to get more information on that.
2MVV
Explorer automatically passes shortened paths if their long versions are too long. It uses this trick in many occasions - when you double click on some file, drag-n-drop it or create a shortcut to it. If you double clicked on a file from the example in your first post, this would be launched:
Explorer automatically passes shortened paths if their long versions are too long. It uses this trick in many occasions - when you double click on some file, drag-n-drop it or create a shortcut to it. If you double clicked on a file from the example in your first post, this would be launched:
Code: Select all
"C:\Windows\system32\NOTEPAD.EXE" F:\Temp\123456~1\123456~1\
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\1.txt
Windows 10 Pro x64, Windows 11 Pro x64
The tip with the explorer seems not applicable here because how would I know where to trim?
Ok after some tests, it seems that all winamp versions have this problem.
If I check the filename in winamp with right click info I can see the correct long filename with path. It's just that winamp is refusing to play.
BTW drag and drop from TC works fine.
Ok after some tests, it seems that all winamp versions have this problem.
If I check the filename in winamp with right click info I can see the correct long filename with path. It's just that winamp is refusing to play.
BTW drag and drop from TC works fine.
ok it works now with the short name.
not very beautiful, the cmd window is open for 1 second, but it works now for .mp3 and .m3u.
I used the following internal association:
and the following helper script to produce a short name:
mp3helper.cmd
thx guys
not very beautiful, the cmd window is open for 1 second, but it works now for .mp3 and .m3u.
I used the following internal association:
Code: Select all
"%commander_path%\.scripts\m3u\mp3helper.cmd" "%commander_path%\ess\thx\winamp\winamp.exe" "/ADD" "%1"
mp3helper.cmd
Code: Select all
REM creates a short name filename with path of input parameter
for %%a in ("%~3") do "%~1" %~2 "%%~fsa"
That's because names are kept in dynamic strings with unlimited length but if you want to open such file with long name, you must add special prefix to its name (blame Microsoft for such a stupid idea).If I check the filename in winamp with right click info I can see the correct long filename with path. It's just that winamp is refusing to play.
You can create LNK for CMD and set 'minimized' in its properties and then specify LNK instead of CMD in internal associations.not very beautiful, the cmd window is open for 1 second, but it works now for .mp3 and .m3u.
ok i solved it with hstart.exe (http://www.ntwind.com/software/hstart.html) and the following internal association:
Code: Select all
"%commander_path%\ess\util\cli\hstart.exe" /NOCONSOLE ""%commander_path%\.scripts\m3u\mp3helper.cmd" "%commander_path%\ess\thx\winamp\winamp.exe" "/ADD" "%1""