$ echo $PATH

$ which PDFXCview.exe

$ ls /home/t/bin/PDFXCview.exe  -l
lrwxrwxrwx 1 t t 97 Mar 18 09:20 /home/t/bin/PDFXCview.exe -> ../program_files/document/formats/pdf/TrackerSoftware/pdfxcview/pdfxchange_portable/PDFXCview.exe


$ wine /home/t/bin/PDFXCview.exe   &
[1] 23220

But even though PDFXCview.exe is searcheable in $PATH,

$ wine PDFXCview.exe
wine: cannot find L"C:\\windows\\system32\\PDFXCview.exe"

Is the failure because that PDFXCview.exe does not appear as a command name in wine PDFXCview.exe, so it is not searched in $PATH?

Is there some way to make PDFXCview.exe in wine PDFXCview.exe searched in $PATH?



There are two ways to make Wine programs available from a path.

  1. You can make the Windows program executable, and add its containing directory to your PATH; see Transparently run wine programs and How is Mono magical? for details. You’d then run


    to start the program.

  2. You can add the Wine directory containing the executable to the Wine path. To do this, run wine regedit, find the HKEY_CURRENT_USER/Environment entry, and edit the Path value (using ; to separate directories). You can use winepath to convert Linux paths to Wine paths. You’d then run

    wine PDFXCview

    to start the program.

  • Thanks. Is it a good idea to put alias PDFXCview="wine /home/t/bin/PDFXCview.exe" in ~/.profile? – Tim Mar 20 '18 at 13:33
  • Yes, that works too (in .bashrc or .zshrc rather than .profile though). The difference is that you need one alias per program, instead of one path entry per directory containing programs you want to run. – Stephen Kitt Mar 20 '18 at 14:18
  • Thanks. (1) Why define environment variables in ~/.profile or ~/.bash_profile, and alias and functions in ~/.bashrc? unix.stackexchange.com/q/431832/674 (2) unix.stackexchange.com/a/76641/674 suggests to write a shell script for each .exe file, so it is still done per program, just as alias is, isn't it? – Tim Mar 21 '18 at 19:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.