www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/04/12/15:24:02

From: "John M. Aldrich" <fighteer AT cs DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: system() with command line options
Date: Fri, 11 Apr 1997 13:07:56 -0700
Organization: Two pounds of chaos and a pinch of salt
Lines: 27
Message-ID: <334E9A1C.7EE@cs.com>
References: <2 DOT 2 DOT 16 DOT 19970411142417 DOT 3e5f5d50 AT email DOT psu DOT edu> <334ED416 DOT 43A7 AT cornell DOT edu>
Reply-To: fighteer AT cs DOT com
NNTP-Posting-Host: ppp108.cs.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

A. Sinan Unur wrote:
> 
> > I have a program that will need to run another program with some
> > options. The program line looks like
> > success=system(test.exe -d c:\junk\); .
> 
> anyway, did you try specifying the full path for the executable? i do
> not know if system inherits the path or starts with a clean one. or
> maybe test.exe is not in the path to begin with?

No, system() under djgpp is supposed to inherit the entire environment
of the parent process.  I suppose it's possible that his SHELL variable
doesn't specify enough memory for the environment, and some of the
variables that are added by the djgpp startup code are getting chopped
off in the call to system().

To the original poster:  Try editing your 'config.sys'.  Find the line
that says "SHELL=C:\DOS\COMMAND.COM" or something similar.  It might say
"COMSPEC" instead of "SHELL".  Add " /E:2048" to the end of that line,
save, and reboot your computer.  This can't hurt anything and may help
solve the problem.

-- 
---------------------------------------------------------------------
| John M. Aldrich, aka Fighteer I  |        fighteer AT cs DOT com         |
| Call me for your free AOL disk!  |   http://www.cs.com/fighteer   |
---------------------------------------------------------------------

- Raw text -


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