www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/02/09/09:40:29

Date: Mon, 9 Feb 1998 16:40:02 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Angelo Maffia <arpbox AT tin DOT it>
cc: djgpp AT delorie DOT com
Subject: Re: DOS COMMAND EXECUTION IN A DJGPP PROGRAM
In-Reply-To: <6bmorh$7l8@everest.vol.it>
Message-ID: <Pine.SUN.3.91.980209163754.9861B-100000@is>
MIME-Version: 1.0

On Mon, 9 Feb 1998, Angelo Maffia wrote:

> I need to know please how i can execute a dos command in my c-programs, i.e.
> a file batch.

Use the library function `system', like this:

	#include <stdlib.h>
	...
	int status = system ("mybatch");

This will look for a batch file `mybatch.bat' in the current directory, 
then along the PATH, and if found, will run it.

You should read the documentation of `system' in the library reference, 
before using it.

- Raw text -


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