Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

Opening files from cygwin shell


  • Please log in to reply

#1
Aiwendil42

Aiwendil42

    Member

  • Member
  • PipPip
  • 10 posts
Not sure if this is the right forum for this, but I think it's the most appropriate.

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:

#!/bin/sh
exec /cygdrive/c/'Program Files/Windows NT/Accessories'/WORDPAD `cygpath -w $1`

and

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.
  • 0

Advertisements







Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP