How convert Linux path to Windows path like "cygpath&qu

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
KenJackson
Level 2
Level 2
Posts: 24
Joined: Mon Apr 14, 2008 11:01 am

How convert Linux path to Windows path like "cygpath&qu

Post by KenJackson »

I'm forced to use Windows at work, so I make very heavy use of Cygwin, a very wonderful thing. One way I use it is with this handy little shell script:

Code: Select all

#!/bin/sh
MSO="/cygdrive/c/Program Files/Microsoft Office/OFFICE11"
if [ -n "$1" ]; then
    "$MSO"/WORDVIEW.EXE "$(cygpath -w "$@")" &
else
    "$MSO"/WORDVIEW.EXE &
fi
Now I have installed Microsoft's free wordview program on my Linux machine under wine and would like to use this script to easily view word documents.

But I need an equivalent to the cygpath command.

How can I automatically convert a Linux path like ~/doc/SomeFile.doc to a Windows path like
H:\\doc\\SomeFile.doc?
rein
Level 2
Level 2
Posts: 18
Joined: Mon Mar 23, 2009 11:05 am

Re: How convert Linux path to Windows path like "cygpat

Post by rein »

KenJackson wrote: How can I automatically convert a Linux path like ~/doc/SomeFile.doc to a Windows path like
H:\\doc\\SomeFile.doc?
That program is called winepath, see "winepath --help"
KenJackson
Level 2
Level 2
Posts: 24
Joined: Mon Apr 14, 2008 11:01 am

Post by KenJackson »

That's it! Thank you, rein.

I think I used to know about winepath. I don't know why it eluded me.
Gert van den Berg

How convert Linux path to Windows path like "cygpath&qu

Post by Gert van den Berg »

On Sat, May 30, 2009 at 14:27, KenJackson <[email protected]> wrote:
But I need an equivalent to the cygpath command.
http://wiki.winehq.org/winepath
Locked