Subject: Re: Win 2000 : Open Files With Word & Excel From The Command Line
From: Christopher Faylor <[email-masked]>
To: [email-masked]
Cc: [email-masked]
Date: Fri, 14 Feb 2003 23:31:54 -0500

On Fri, Feb 14, 2003 at 10:55:22PM -0500, Steve wrote:
>I put script files called "word" and "excel" in my /usr/local/bin. These
>files have the path to the ms word and ms excel executables.
>
>They work, they bring up the apps, but I can't get the apps to take
>command line arguments to open remote files.
>
>For example:
>
>cygwin> word c:/docs/memos/parking/myfile.doc
>
>opens only word not "myfile.doc".
>
>Is there any way around this?  I would love to be able to do this as it
>is monumentally faster then scrolling through a file dialog box or
>explorer to open up a file.

You probably want something like:

[Contents of /usr/local/bin/word]

#!/bin/sh
exec /cygdrive/c/'Program Files/Microsoft Office/Office'/winword `cygpath -w $1`

I don't know if word accepts paths with "forward slashes" or not (don't
think it does) but the above will convert the slashes to backslashes and
will have the added benefit of allowing you to use cygwin style paths,
if you so choose.

cgf

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/