Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!samsung!nstar!thevoid!jonathan From: jonathan@thevoid.fidonet.org (Jonathan Bradshaw) Newsgroups: comp.lang.pascal Subject: Re: Redirecting Exec() output Message-ID: <8533.281B201B@thevoid.fidonet.org> Date: 27 Apr 91 21:46:39 GMT Organization: The VOIDian Gateway, Granger, Indiana, USA Lines: 27 In a message of , Aaron Colvin (acolvin@youth.cavebbs.gen.nz ) writes: > UNZIP FOO.ZIP c:\FOODIR > c:nul > > from the DOS prompt works like a champ. But if you use Exec() from the > DOS unit, and set the parameters like so: > > Exec('UNZIP.EXE','FOO.ZIP c:\FOODIR > c:nul'); > > and the output is no longer redirected to nul. It appears on the screen, > and I assure you it isn't a pretty site in the middle of a TVision program. Argh, you overlooked something a little obvious. Redirection via ">" is part of COMMAND.COM and your bypassing it using the above. You'll need to do something like: Exec('COMMAND.COM', '/c UNZIP.EXE FOO.ZIP C:\FOODIR > NUL'), but PLEASE don't hard code COMMAND.COM since alot of us use 4DOS.COM --- instead use the EnvrStr('COMSPEC') to get the name of the command interpreter. If you don't want to use COMMAND.COM you need to write your own routines to redirect StdOut. -- Jonathan Bradshaw | Internet: jonathan%thevoid@nstar.rn.com - U93 WNDU-FM South Bend (92.9FM) | -OR- jonathan@thevoid.fidonet.org - Forsythe Computers, South Bend | UUCP: ...!uunet!nstar!thevoid!jonathan `The Voidian Gateway of Michiana' | Fidonet: 1:227/1.6 Prodigy: XMSN02B "...anyone can beat the odds if they have the will..." - Debster [DGIF#9588]