This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Run cmd.exe with /c.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]