This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Run cmd.exe with /c.
- From: Linda Walsh <cygwin at tlinx dot org>
- To: cygwin at cygwin dot com
- Date: Tue, 23 Mar 2010 00:26:08 -0700
- Subject: Re: Run cmd.exe with /c.
- References: <ho82hb$59h$1@dough.gmane.org>
Oleksandr Gavenko wrote:
> I want execute .bat file. I think easy way to do this is
> invoke $COMSPEC to do that. Like this
>
> $(subst \,/,$(COMSPEC)) /c file.bat
>
> from Makefile.
>
> But cmd fail with error:
>
> bash# cat 1.bat
> @echo off
> echo xxx
> bash# cmd.exe /c 1.bat
> bash: /cygdrive/c/WINDOWS/system32/cmd.exe: Bad address
----
This is weird.
I get it too:
/tmp> cmd.exe /c dir
bash: /Windows/system32/cmd.exe: Bad address
When /Windows/system32/cmd.exe WORKS!
ie. works:
/Windows/System32/cmd.exe /c dir
Also if you want to use comspec, use it with cygpath:
$(cygpath $COMSPEC) /c dir
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple