winepath is the helper program to convert file paths between UNIX and Windows.


Usage: winepath [OPTION] [PATH]...
Convert PATH(s) to Unix or Windows long or short paths.

  -u, --unix    converts a Windows path to a Unix path
  -w, --windows converts a Unix path to a long Windows path
  -l, --long    converts the short Windows path of an existing file or
                directory to the long format
  -s, --short   converts the long Windows path of an existing file or
                directory to the short format
  -h, --help    output this help message and exit
  -v, --version output version information and exit

If more than one option is given then the input paths are output in all formats specified, in the order long, short, Unix, Windows.

If no option is given the default is Unix format.


$ winepath c:\\

$ winepath "c:\program files"
/home/vitaliy/.wine/dosdevices/c:/Program Files

$ winepath -w ~

$ winepath -w /media/dvd/

To launch documents from inside Windows apps, create a small shell script called e.g. /usr/bin/run_prog containing

$1 "`wine winepath -u "$2"`"

And then add a registry entry like this:

@="/bin/sh run_prog /usr/bin/oocalc \"%1\""

See also winenative - Tres Finocchiaro's script that uses winepath to launch Linux apps from inside Windows apps

This page was last edited on 13 March 2016, at 20:05.