This forum uses cookies. Click X button to hide this message. What is stored? / Privacy
Total Commander Forum Index Total Commander
Forum - Public Discussion and Support
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

TC fails at calling proper command line for external viewer.

 
Post new topic   Reply to topic    Total Commander Forum Index -> TC8.0x bug reports (English) Printable version
View previous topic :: View next topic  
Author Message
avada
Member
Member


Joined: 05 Oct 2007
Posts: 185

PostPosted: Sun Aug 24, 2014 8:32 am    Post subject: TC fails at calling proper command line for external viewer. Reply with quote

Hello!
TC simply can't open some files with an external viewer in specific folders. I see no pattern, but in some folders when there's a space in the file the program gets a broken command line. Also some files with spaces in them can be played, but others don't...

I have this in wincmd ini: (Tried normal full path, or adding a path with TC. but it didn't help)
Code:
flv="%COMMANDER_PATH%\plugins\mplayer\mpv.com" ^.flv
f4v="%COMMANDER_PATH%\plugins\mplayer\mpv.com" ^.f4v
mp4="%COMMANDER_PATH%\plugins\mplayer\mpv.com" ^.mp4
mpeg="%COMMANDER_PATH%\plugins\mplayer\mpv.com" ^.mpeg
mpg="%COMMANDER_PATH%\plugins\mplayer\mpv.com" ^.mpg
m4v="%COMMANDER_PATH%\plugins\mplayer\mpv.com" ^.m4v
mkv="%COMMANDER_PATH%\plugins\mplayer\mpv.com" ^.mkv
avi="%COMMANDER_PATH%\plugins\mplayer\mpv.com" ^.avi
mov="%COMMANDER_PATH%\plugins\mplayer\mpv.com" ^.mov
mpl="%COMMANDER_PATH%\plugins\mplayer\mpv.com" ^.mpl
m2v="%COMMANDER_PATH%\plugins\mplayer\mpv.com" ^.m2v
asd="%COMMANDER_PATH%\plugins\mplayer\mpv.com" ^.asd
asf="%COMMANDER_PATH%\plugins\mplayer\mpv.com" ^.asf
divx="%COMMANDER_PATH%\plugins\mplayer\mpv.com" ^.divx
nsv="%COMMANDER_PATH%\plugins\mplayer\mpv.com" ^.nsv
rm="%COMMANDER_PATH%\plugins\mplayer\mpv.com" ^.rm
rmvb="%COMMANDER_PATH%\plugins\mplayer\mpv.com" ^.rmvb
wmv="%COMMANDER_PATH%\plugins\mplayer\mpv.com" ^.wmv
wma="%COMMANDER_PATH%\plugins\mplayer\mpv.com" ^.wma
mp3="%COMMANDER_PATH%\plugins\mplayer\mpv.com" ^.mp3
m4a="%COMMANDER_PATH%\plugins\mplayer\mpv.com" ^.m4a
flac="%COMMANDER_PATH%\plugins\mplayer\mpv.com" ^.flac
dts="%COMMANDER_PATH%\plugins\mplayer\mpv.com" ^.dts
dtshd="%COMMANDER_PATH%\plugins\mplayer\mpv.com" ^.dtshd
part="%COMMANDER_PATH%\plugins\mplayer\mpv.com" ^.part
vob="%COMMANDER_PATH%\plugins\mplayer\mpv.com" ^.vob
m2ts="%COMMANDER_PATH%\plugins\mplayer\mpv.com" ^.m2ts
ogg="%COMMANDER_PATH%\plugins\mplayer\mpv.com" ^.ogg
ts="%COMMANDER_PATH%\plugins\mplayer\mpv.com" ^.ts
tak="%COMMANDER_PATH%\plugins\mplayer\mpv.com" ^.tak
opus="%COMMANDER_PATH%\plugins\mplayer\mpv.com" ^.opus
mka="%COMMANDER_PATH%\plugins\mplayer\mpv.com" ^.mka
wv="%COMMANDER_PATH%\plugins\mplayer\mpv.com" ^.wv
wav="%COMMANDER_PATH%\plugins\mplayer\mpv.com" ^.wav
bik="%COMMANDER_PATH%\plugins\mplayer\mpv.com" ^.bik
m4r="%COMMANDER_PATH%\plugins\mplayer\mpv.com" ^.m4r
webm="%COMMANDER_PATH%\plugins\mplayer\mpv.com" ^.webm
mts="%COMMANDER_PATH%\plugins\mplayer\mpv.com" ^.mts
m2t="%COMMANDER_PATH%\plugins\mplayer\mpv.com" ^.m2t


If I have practically same as a button it works:

Code:
TOTALCMD#BAR#DATA
%COMMANDER_PATH%\plugins\mplayer\mpv.com
%P%N
%COMMANDER_PATH%\plugins\mplayer\mpv.exe

%COMMANDER_PATH%\plugins\mplayer\

-1



For example these don't play:
"h:\t\video file.mp4"
"e:\videˇ\hangszer\Swiss Alphorns.mp4"

But these do:
"h:\t\asdf.mp4"
"d:\t\video file.mp4"
"e:\videˇ\hangszer\Viola D'amore.flv"
"e:\videˇ\hangszer\video file.flv"


I get something like this:
Image: http://abload.de/img/tc-mpv8wr1b.png

Also I notice that with the button I always get proper filename, while with f3 I sometimes get the crappy 8.3 filenames.
Back to top
View user's profile Send private message
Horst.Epp
Power Member
Power Member


Joined: 06 Feb 2003
Posts: 2926
Location: Germany

PostPosted: Sun Aug 24, 2014 9:01 am    Post subject: Reply with quote

A strange way to configure an external viewer.
But an extension entry made witf TC looks as follows:
pdf=""C:\Program Files\SumatraPDF\SumatraPDF.exe" ^.pdf"
So your entries are wrong for me.
Back to top
View user's profile Send private message
avada
Member
Member


Joined: 05 Oct 2007
Posts: 185

PostPosted: Sun Aug 24, 2014 9:39 am    Post subject: Reply with quote

Horst.Epp wrote:
A strange way to configure an external viewer.
But an extension entry made witf TC looks as follows:
pdf=""C:\Program Files\SumatraPDF\SumatraPDF.exe" ^.pdf"
So your entries are wrong for me.

As I mentioned I made a new entry with TC too for testing. Still didn't work.

Just tried again for a couple formats and I got this:
Code:
avi=C:\totalcmd\plugins\mplayer\mpv.com ^.avi
mp4=C:\totalcmd\plugins\mplayer\mpv.com ^.mp4
wmv=C:\totalcmd\plugins\mplayer\mpv.com ^.wmv
mkv=C:\totalcmd\plugins\mplayer\mpv.com ^.mkv


Didn't change anything. Tried it the way you had it. Also didn't change anything.

Something's bugged with TC.
Back to top
View user's profile Send private message
HolgerK
Power Member
Power Member


Joined: 26 Jan 2006
Posts: 4804
Location: Europe, Aachen

PostPosted: Sun Aug 24, 2014 10:37 am    Post subject: Reply with quote

2avada

1) Does it work if you use
C:\totalcmd\plugins\mplayer\mpv.exe
instead of
C:\totalcmd\plugins\mplayer\mpv.com

2) Does ist work if you manually edit the association like
avi=C:\totalcmd\plugins\mplayer\mpv.com "%1" ^.avi

3) Did you disable the short dos name creation for ntfs drives:
NtfsDisable8dot3NameCreation=1

Related: file name containing spaces aren't properly handled

Regards
Holger
Back to top
View user's profile Send private message Send e-mail
avada
Member
Member


Joined: 05 Oct 2007
Posts: 185

PostPosted: Sun Aug 24, 2014 12:52 pm    Post subject: Reply with quote

HolgerK wrote:
2avada

1) Does it work if you use
C:\totalcmd\plugins\mplayer\mpv.exe
instead of
C:\totalcmd\plugins\mplayer\mpv.com

2) Does ist work if you manually edit the association like
avi=C:\totalcmd\plugins\mplayer\mpv.com "%1" ^.avi

3) Did you disable the short dos name creation for ntfs drives:
NtfsDisable8dot3NameCreation=1

Related: file name containing spaces aren't properly handled

Regards
Holger


1) Apparently it does. Apparently a broken command line is only sent to the .com variant (which I used because I wanted the CLI window for information)

2) It also works. Nice workaround!

3) Didn't touch it. But I really hope TC doesn't rely on it for anything, in this day and age.
Back to top
View user's profile Send private message
ghisler(Author)
Site Admin
Site Admin


Joined: 04 Feb 2003
Posts: 35767
Location: Switzerland

PostPosted: Mon Aug 25, 2014 7:16 am    Post subject: Reply with quote

.com programs are 16-bit only, and don't support long file names.
_________________
Author of Total Commander
http://www.ghisler.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
HolgerK
Power Member
Power Member


Joined: 26 Jan 2006
Posts: 4804
Location: Europe, Aachen

PostPosted: Mon Aug 25, 2014 8:22 am    Post subject: Reply with quote

ghisler(Author) wrote:
.com programs are 16-bit only

Not necessary true.
http://stackoverflow.com/questions/2115651/difference-between-com-exe-and-bat wrote:
However DOS and Windows eventually went to a model where the file extension in a .COM and .EXE didn't mean anything. The program loader first checks the first two bytes of the file. If it happens to be the string MZ (legend has it this stands for the initials of an early Microsoft employee), it will treat it as an EXE, otherwise it will load it as if it were a COM file. Since MZ doesn't map to a sensible x86 instruction to start a program, they can get away with this. Net effect: In some versions of DOS/Windows, an .EXE can be named with .COM and vice versa. For example, in many versions of DOS/Windows, the famous COMMAND.COM was actually an EXE.

Just try it. Rename a 64 bit notepad.exe to notepad.com. Wink
I would not suggest to use the .com extension for modern executables, but in fact windows checks the header for "MZ" and uses the program loader strategy instead of simply mapping max 64kB into memory and execute the first instruction of the memory block.

Regards
Holger
Back to top
View user's profile Send private message Send e-mail
avada
Member
Member


Joined: 05 Oct 2007
Posts: 185

PostPosted: Mon Aug 25, 2014 12:52 pm    Post subject: Reply with quote

ghisler(Author) wrote:
.com programs are 16-bit only, and don't support long file names.

Even if it's true TC fails to use the short filenames for a lot of files with spaces in their names. It seems to me that it just passes the filenames without quotes.
Also with HolgerK's workaround the mpv.com program is always called with a working command line, where the filename is always in the long format.
Back to top
View user's profile Send private message
avada
Member
Member


Joined: 05 Oct 2007
Posts: 185

PostPosted: Wed Aug 27, 2014 1:23 pm    Post subject: Reply with quote

HolgerK wrote:

Not necessary true.
http://stackoverflow.com/questions/2115651/difference-between-com-exe-and-bat wrote:
However DOS and Windows eventually went to a model where the file extension in a .COM and .EXE didn't mean anything. The program loader first checks the first two bytes of the file. If it happens to be the string MZ (legend has it this stands for the initials of an early Microsoft employee), it will treat it as an EXE, otherwise it will load it as if it were a COM file. Since MZ doesn't map to a sensible x86 instruction to start a program, they can get away with this. Net effect: In some versions of DOS/Windows, an .EXE can be named with .COM and vice versa. For example, in many versions of DOS/Windows, the famous COMMAND.COM was actually an EXE.

Just try it. Rename a 64 bit notepad.exe to notepad.com. Wink
I would not suggest to use the .com extension for modern executables, but in fact windows checks the header for "MZ" and uses the program loader strategy instead of simply mapping max 64kB into memory and execute the first instruction of the memory block.

Regards
Holger

BTW mpv.com starts with MZ.
Back to top
View user's profile Send private message
joker
Junior Member
Junior Member


Joined: 05 Apr 2006
Posts: 20

PostPosted: Thu Nov 06, 2014 6:30 am    Post subject: Reply with quote

avada wrote:
ghisler(Author) wrote:
.com programs are 16-bit only, and don't support long file names.

Even if it's true TC fails to use the short filenames for a lot of files with spaces in their names. It seems to me that it just passes the filenames without quotes.
Yes, just quote the parameter for the file name.

avada wrote:
Also with HolgerK's workaround the mpv.com program is always called with a working command line, where the filename is always in the long format.
Because he quoted the file name.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Total Commander Forum Index -> TC8.0x bug reports (English) All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Imprint/Impressum: This site is maintained by Ghisler Software GmbH
Privacy Policy | Datenschutzerklńrung | Politique de ConfidentialitÚ

Using phpBB © phpBB Group