delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/06/09/02:05:49

Date: Mon, 9 Jun 1997 09:01:49 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: krusty AT miyares DOT slip DOT duq DOT edu
cc: djgpp AT delorie DOT com, ckeenan AT scsn DOT net
Subject: Re: Making system calls in DJGPP???
In-Reply-To: <5neop7$shn@news.duq.edu>
Message-ID: <Pine.SUN.3.91.970609090027.15943A-100000@is>
MIME-Version: 1.0

On 8 Jun 1997, Real Email in Sig! wrote:

> : I need to make a call to the system to run a file.  
> : 
> : If I run it like this:
> : 
> : system("program.exe");
> : 
> : it works fine, but when I use a .bat to allow the user to configure
> : the program being called, it just ignores it.
> : 
> : How can I get it to run
> : 
> : system("program.bat");
> : 
> : where program.bat is simply program.exe -1 -2??
> 
> I think you need to run a copy of command.com to execute a bat file.

This is incorrect.  Please don't post untested info.

You can call `system' to run a batch file, and it should find COMMAND.COM
and invoke it automatically.  For example, the following short program
works for me: 

    #include <stdlib.h>

    int main (void)
    {
      return system ("foobar.bat");
    }

where `foobar.bat' is any batch file that pleases me, whether it is in
the current working directory or on the PATH.

Chris, can you please tell what version of DJGPP do you have, and what
size and time stamp is your libc.a file in the DJGPP's lib
subdirectory?  Thanks.

- Raw text -


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