From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,dc6ab937143a5e6f X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-02-25 10:22:53 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!newsmi-us.news.garr.it!newsmi-eu.news.garr.it!NewsITBone-GARR!irazu.switch.ch!switch.ch!in2p3.fr!proxad.net!usenet-fr.net!enst.fr!melchior!cuivre.fr.eu.org!melchior.frmug.org!not-for-mail From: "David C. Hoos" Newsgroups: comp.lang.ada Subject: Re: Send command to the Windows prompt from Ada procedure Date: Wed, 25 Feb 2004 12:20:52 -0600 Organization: Cuivre, Argent, Or Message-ID: References: NNTP-Posting-Host: lovelace.ada-france.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: melchior.cuivre.fr.eu.org 1077733280 62705 212.85.156.195 (25 Feb 2004 18:21:20 GMT) X-Complaints-To: usenet@melchior.cuivre.fr.eu.org NNTP-Posting-Date: Wed, 25 Feb 2004 18:21:20 +0000 (UTC) Cc: "comp.lang.ada@ada.eu.org" To: "Lele" Return-Path: X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Virus-Scanned: by amavisd-new-20030616-p7 (Debian) at ada-france.org X-BeenThere: comp.lang.ada@ada-france.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Gateway to the comp.lang.ada Usenet newsgroup" List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Xref: archiver1.google.com comp.lang.ada:5811 Date: 2004-02-25T12:20:52-06:00 ----- Original Message ----- From: "Lele" Newsgroups: comp.lang.ada To: Sent: Wednesday, February 25, 2004 10:48 AM Subject: HELP: Send command to the Windows prompt from Ada procedure > Hi, > does anyone show me the simplest way to perform a windows system call using > Ada ? > I've to call a batch file from my not-professional Ada procedure, or I've to > send command to the windows prompt (command.com) . How can I do that? > Thanx for the advices. > Here is a library-level function that invokes the "system" function of the C-runtime library. with Interfaces.C; function Execute_Shell_Command (Command : in String) return Integer is function Execute (Command : in Interfaces.C.char_array) return Interfaces.C.int; pragma Import (C, Execute, "system"); begin -- Execute_Shell_Command return Integer (Run (Interfaces.C.To_C (Item => Command))); end Execute_Shell_Command;