I'm having trouble opening text documents from the cygwin command line, with both Microsoft Word and Wordpad. I put the following scripts in my cygwin/usr/local/bin directory:
wordpad (file name), containing:
and#!/bin/sh
exec /cygdrive/c/'Program Files/Windows NT/Accessories'/WORDPAD `cygpath -w $1`
word, containing:
#!/bin/sh
exec /cygdrive/c/'Program Files/Microsoft Office/Office11'/winword `cygpath -w $1`
When I try to open a file with, e.g., the command:
word example.txt
... Word opens but instead of the file I get a message:
Word experienced an error trying to open the file.
Try these suggestions:
*Check the file permissions for the document or drive
*Make sure there is sufficient free memory and disk space
*Open the file with the text recovery converter
But I'm able to open the same file from Windows explorer. Similarly, when I try:
wordpad example.txt
... Wordpad appears to open, but I get a message:
Failed to open document
and then wordpad quits.
I'm probably making some very simple mistake, but if anyone could help I'd really appreciate it. Thanks.