Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com From: "Dave Korn" To: Subject: RE: g77, Windows XP Professional, CALL System(Command, Status) Date: Fri, 19 Mar 2004 15:34:28 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit In-Reply-To: Message-ID: X-OriginalArrivalTime: 19 Mar 2004 15:34:29.0562 (UTC) FILETIME=[AB3AB1A0:01C40DC7] > -----Original Message----- > From: cygwin-owner On Behalf Of Lars Steinke > Sent: 19 March 2004 15:19 > if I use: > > call system('cls') > > I get the following (new) message: > > cls: not found > > If I write the cls-command manually in the Win-XP-shell, it works. > If my program tries to invoke the cls command in the > Win-XP-shell it does not work? That's presumably because cls is a builtin command to the XP shell, rather than a separate executable; presumably the system command is trying and failing to execute a program called "cls.exe". Instead, try passing cls to the shell like this: > call system('cmd.exe /c cls') You'll probably also need to do the same for other commands such as 'cd' or 'dir' if you ever want to use them in system calls. BTW, I see you're using cygwin. That trick is also very useful in bash shell: I have things like alias cls='cmd /c cls' alias start='cmd /c start ' in my .bashrc cheers, DaveK -- Can't think of a witty .sigline today.... -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/