delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2000/04/26/10:40:47

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sourceware DOT cygnus DOT com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sourceware DOT cygnus DOT com>
List-Help: <mailto:cygwin-help AT sourceware DOT cygnus DOT com>, <http://sourceware.cygnus.com/ml/#faqs>
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
Message-ID: <F1932D194B56D111965A00805F85190F01D388A3@caucase.grenoble.xrce.xerox.com>
From: "Berche, Guillaume" <Guillaume DOT Berche AT mkms DOT xerox DOT com>
To: "'earnie_boyd AT yahoo DOT com'" <earnie_boyd AT yahoo DOT com>,
"'cygwin AT sourceware DOT cygnus DOT com'" <cygwin AT sourceware DOT cygnus DOT com>
Subject: RE: Cygwin 1.0: Error when launching MSDOS bat file from bash on
Windows 2000
Date: Wed, 26 Apr 2000 17:35:44 +0200
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2650.21)

Earnie,

Well, I've finally understood why it does not work on Windows 2000. On 2000, the cmd.exe is more restrictive that in NT: it does not accept path with forward slashes '/' as it does in NT 4.0

The workaround I use for interactive use it to define the following alias:
start_file () {
    cmd /c `cygpath -w $1`
}	
alias start=start_file

Then I would type in my bash shell:

> start ./test1/test2/run.bat

Note that it also works for other type of files such as MS words files (it launches MS-Word), PDF, HTML, and all the files whose extension have been mapped to an application on the NT workstation.

For our bash scripts, we'll specifically invoke cmd /c `cygpath -w ./test1/test2/run.bat`

I hope this can help other cygwin users.

Regards,

Guillaume.


> 
> WOW!!  I just tried starting bash for MSDOS CMD.EXE using 
> forward slashes in
> the path and it worked!! :0  Too bad I can't cd to the 
> directory using forward
> slashes.
> 
> Chris, the problem isn't that foo.bat won't execute under 
> Cygwin bash, it will.
>  The problem is that it won't execute with relative paths.  
> Absolute paths work
> great.  I was able to emulate Guillaume's problem with his example.
> 
> Example:
> 
> ---foo.bat---
> REM This will execute under the MSDOS shell.
> PAUSE
> REM End of foo.bat
> ---end foo.bat---
> 
> /path/to/foo.bat; #works
> path/to/foo.bat; #doesn't work
> ./path/to/foo.bat; #works
> 
> Cheers,
> 

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019