I want to use PDF-XChange Editor to open pdf files from within mc. I tryed settingOpen=wine ~/PDFXEdit6_Portable/PDFXEdit.exe %fin  mc.ext, but it opens only the application, not the file.[edit]  It seems to me the syntax of this field is close to that of exec in .desktop files, so I tried to adapt some of the solutions proposed on How to pass file as argument in .desktop file for wine application, but without success yet.
How to open files with a wine application from mc?
pdf;wine;mc
Short answer.You are using %f, but the filename You want to pass is stored in ${MC_EXT_FILENAME} variable.Long answer.How to open / view PDF files using Midnight Commander + wine + PDF-XChange Viewer / Editor Portablenote: I assume that windows portable apps are stored in ~/MyApps/*open Midnight Commander extension file for editing: F9-> Command -> Edit extension filenavigate to the section of the file where PDF configuration is written:type /pdfEntercomment out the following lines (just for a backup):# PDF#type/^PDF#       Open=/usr/lib/mc/ext.d/doc.sh open pdf#       View=%view{ascii} /usr/lib/mc/ext.d/doc.sh view pdfadd / replace with the following lines:# PDFtype/^PDF        Open=~/MyApps/start-pdf-mc.sh        View=%view{ascii} ~/MyApps/start-pdf-mc.shexit and save the changes: :wqcreate the ~/MyApps/start-pdf-mc.sh file with the following content:#!/bin/bashFilename=z:${MC_EXT_FILENAME//\//\\}App=`eval wine ~/MyApps/PDF-XChange_Viewer/PDFXCview.exe '$Filename' > /dev/null 2>&1 &`$Appnote: You might want to create it in /usr/lib/mc/ext.d/*.sh (instead of ~/MyApps/ as I did)make sure start-pdf-mc.sh file is executable (use chmod)explanation of the start-pdf-mc.sh filethe filename we are trying to open is stored in ${MC_EXT_FILENAME}variablewhen using wine, use drive letter z:convert Linux-style file path (/) to Windows-style (\) with thefollowing: ${MC_EXT_FILENAME//\//\\} to pass it as an argument toPDF-XChange Viewer later> /dev/null 2>&1 and & are required to discard program output and to run it as a background process, otherwise (if you omit this), You've won't be able to use Midnight Commander till You close PDF-XChange Viewer which is obviously not desirabletested with the following softwareLinux Debian 32-bitGNU Midnight Commander 4.8.13wine-1.6.2PDF-XChange Viewer v2.5.316.1ANDLinux Debian 32-bitGNU Midnight Commander 4.8.13wine-1.6.2PDF-XChange Editor v6.0.321.0update according to Your commentIt seems that there is still some error in the filepath... Let's try to correct it.1.Open problematic pdf file with PDFXChange Editor (as you usually do, NOT with the Midnight Commander)File -> Copy Full File NamePaste it in any text file (just for later reference)Close PDFXChange EditorOpen the same file with Midnight Commander + PDFXChange Editor (which shows your error message)Compare if the file paths are identical (the one that You've justpasted for reference and the one in Your error message)If the paths are NOT identical - correct the path accordingly in .sh file OR paste them here for me to help (just replace your username in the path with <username> for security)2.Also, this is not so likely, BUT if the paths ARE identical there might be an issue with permissions that are set on the file you are trying to open. Thus verify your file permissions are at least:sudo chmod 644 your-file-name-here.pdfupdate 2It is possible to have access to all files from all drives including those that are NOT located in the ~/* (home user directory) or even stored on other HDDs just by using Z:\ (not using H:\ and other drive letters at all).Check Your drive mapping in wine:run in terminal$ winecfgopen the Drives tabthe following records have to be there by defaultLetter | Drive MappingC:     | ../drive_cZ:     | /As far as I know, any path starts with / (for any file on any HDD accessed in Linux) and thus can be accessed using the Z:\, because of the mapping described above.For example, the above config allows me to access a pdf filefrom /home/<username>/*.pdf (~/*.pdf), if it's located in homeuser directoryfrom /media/<drive-label>/*.pdf OR /mnt/<drive-label>/*.pdf, if it's located on some external drive or HDD, that I've mounted; (in windows the same drive might be accessed using the H:\, for example)Drive mappings, however, would be another question, specific to Your setup. :-)BTW, one more thing to check. Is your user home directory ~/* mapped to wine's My Documents folder?in terminal: $ wine explorerdouble click on My Documents folderYou should see the contents of your Linux ~/* home directory