Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!rochester!pt.cs.cmu.edu!o.gp.cs.cmu.edu!andrew.cmu.edu!tp1l+ From: tp1l+@andrew.cmu.edu (Thomas W. Pope) Newsgroups: comp.lang.c Subject: system() command Message-ID: Date: 3 Feb 91 04:50:49 GMT Organization: Carnegie Mellon, Pittsburgh, PA Lines: 26 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.