how to get into dos mode & run .bat or .cmd file

Eliot Moss moss@cs.umass.edu
Wed Aug 17 20:35:00 GMT 2011


On 8/17/2011 4:26 PM, J.V. wrote:
> I want a bash / shell script that I can run that will go into dos mode, and from there run a .bat or
> a .cmd script automatically.
>
> After much googl'ing and experimenting, I cannot quite get it to run a dos shell and run a .bat or
> .cmd.
>
> any help would be appreciated.

If you have a .bat file named foo.bat, then you can run
simply by:

foo.bat

from a bash command line or shell script file.  You can pass
arguments as well.  There is no automatic conversion between
Windows and cygwin/Unix-style paths, so you may find the
cygpath utility helpful.

I am not sure what "going into dos mode" would mean, but you
can also run cmd.exe from the command line by typing:

cmd

In the case of both cmd and foo.bat, their directories need
to be in your search path, or else offered explicitly.

Best wishes -- Eliot Moss

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



More information about the Cygwin mailing list