LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

winepath

Convert paths between Unix and Windows formats in a Wine prefix

TLDR

Convert a Windows path to a Unix path (this is also the default)
$ winepath --unix '[C:\path\to\file]'
copy
Convert a Unix path to a long Windows path
$ winepath --windows [path/to/file]
copy
Convert an existing file's short (8.3) Windows path to long form
$ winepath --long '[C:\PROGRA~1]'
copy
Convert an existing file's long Windows path to short (8.3) form
$ winepath --short '[C:\Program Files]'
copy
Print several Unix paths NUL-separated (for xargs -0)
$ winepath --unix -0 [path1] [path2]
copy

SYNOPSIS

winepath [option...] [path...]

DESCRIPTION

winepath converts file paths between Unix and Win32 forms for the Wine prefix named by WINEPREFIX (default ~/.wine). Windows programs see drive letters and backslashes; Unix tools see drive_c and forward slashes. winepath is the command-line bridge between those two views.If more than one format option is given, each input path is printed in every requested format, in the order long, short, Unix, Windows. With no format option, Unix format is used. Unlike wine start /unix, winepath only prints converted names; it does not launch anything.

PARAMETERS

-u, --unix

Convert a Windows path to a Unix path. This is the default if no format option is given.
-w, --windows
Convert a Unix path to a long Windows path (for example C:\Program Files\...).
-l, --long
Convert the short Windows path of an existing file or directory to the long format. The path must exist in the prefix.
-s, --short
Convert the long Windows path of an existing file or directory to the short (8.3) format. The path must exist in the prefix.
-0
Separate output records with a NUL byte instead of a newline.
-h, --help
Print the help message and exit.

INSTALL

sudo dnf install wine
copy
sudo pacman -S wine
copy
sudo apk add wine
copy
nix profile install nixpkgs#wine
copy

CAVEATS

--long and --short require the path to exist; they fail silently (empty line) for missing files. Conversion follows the current prefix's drive mappings, so a path that is valid in one WINEPREFIX may not convert in another. Quote Windows paths that contain backslashes or spaces so the shell does not eat them.

HISTORY

winepath is part of Wine, the Windows compatibility layer begun in 1993. The Unix helper was added so scripts and native file managers could translate paths without starting a Windows program.

SEE ALSO

wine(1), wine-start(1), wineboot(1), winecfg(1)

RESOURCES

Copied to clipboard
Kai