Skip to content

Instantly share code, notes, and snippets.

Created Dec 22, 2012
What would you like to do?
Example of how to pass a *nix (or OSX) file path to a windows program (run from WINE). Uses the example of IrfanView in a default installation on a default WINE install.
# This is a bash script to properly pass a *nix or OS X path to a Windows program
# running under WINE.
# Written by Steven Saus (uriel1998)
# This work is licensed under the Creative Commons Attribution-ShareAlike 3.0
# Unported License. To view a copy of this license, visit
# As usual, please change USER to your appropriate path. I am using the example
# of the AWESOME quick image handler IrfanView here:
# which is installed to my main WINE directory. This script is made executable
# and placed in my path; if it's called with any parameters that are filenames
# it pulls up the file (or the first image in a directory if you pass a directory).
# Requires SED:
# References:
export WINEPREFIX="/home/USER/.wine"
export WINEDEBUG="-all"
cd "/home/USER/.wine/drive_c/Program Files/IrfanView"
passfile=" "
if [ "$#" -gt "0" ]; then
if [ -a "$1" ]; then
if [ "$passfile" != " " ]; then
winpassfile=$(echo "$passfile" | sed -e 's@/@\\@g')
wine "/home/USER/.wine/drive_c/Program Files/IrfanView/i_view32.exe" "z:$winpassfile"
wine "/home/USER/.wine/drive_c/Program Files/IrfanView/i_view32.exe"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment