delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2011/09/17/07:49:21

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS
X-Spam-Check-By: sourceware.org
To: cygwin AT cygwin DOT com
From: Thorsten Kampe <thorsten AT thorstenkampe DOT de>
Subject: Re: how to run a .bat or .cmd file from bash prompt
Date: Sat, 17 Sep 2011 13:48:29 +0200
Lines: 20
Message-ID: <j521el$r6j$1@dough.gmane.org>
References: <4E739D87 DOT 4060806 AT gmail DOT com>
Mime-Version: 1.0
User-Agent: MicroPlanet-Gravity/3.0.4
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

* J.V. (Fri, 16 Sep 2011 13:03:35 -0600)
> To run a .bat or .cmd file, I can do this:
>      $cmd
> 
>      C:>mybat.bat or C:\>mycmd.cmd
> 
> In other words, I have to type two commands (one to get to the shell, 
> and another to run the .bat or .cmd file).
> 
> What I want is to write a shell script (bash), that will cd to a 
> directory, enter the dos cmd prompt and execute a .bat file and then 
> return to my bash shell.
> 
> I do not know if this is possible, have tried many things, but nothing 
> works.

Now that is a really detailed description of what you tried. Anyway, you 
can run a batch script like any other script. It just works.

Thorsten


--
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

- Raw text -


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