system() command

Thomas W. Pope tp1l+ at andrew.cmu.edu
Sun Feb 3 15:50:49 AEST 1991


   I am writing a short program to put into my autoexec file, allowing me
to select a shorter autoexec by hitting a key.  For this I tried to use the
system() command to run either of two batch files.  The command works fine, but
the program stays resident after that call, adding 64k to my memory usage.
   The Turbo C manuals say that the system command will run batch files fine,
but it seems to terminate withour clearing memory every time I try it...  Does
anyone know how I could make these calls from my program???  I have tried the
following calls:


   system(default)              system(call default)
   execvp("default.bat")        execvp("dobat.exe",default.bat")
the system calls all ran the batch files correctly, but the program still
didn't exit gracefully.  The execvp() calls wouldn't recognise either the
batch files or the dobat.exe with the batch files as parameters.
   Any help would be greatly appreciated...


  Thanks in advance

   -Thomas Pope

P.S.  Dobat.exe is a shareware program that allows you to call a batch file
      from within another batch file, and return to the calling file
      when finished.



More information about the Comp.lang.c mailing list