Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!munnari.oz.au!uniwa!cc.curtin.edu.au!sdalelt From: sdalelt@cc.curtin.edu.au Newsgroups: comp.lang.pascal Subject: Re: Redirecting Exec() output Message-ID: <1991Apr29.155721.7946@cc.curtin.edu.au> Date: 29 Apr 91 07:57:21 GMT References: <2435@pdxgate.UUCP> Organization: Curtin University of Technology Lines: 26 In article <2435@pdxgate.UUCP>, mwizard@eecs.cs.pdx.edu (Craig Nelson) 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. DOS performs the re-direction for you! You'll need to spawn a command processor in order for the redirection to work! ie. exec(getenv('COMSPEC'),'UNZIP.EXE FOO.ZIP C:\FOODIR > nul'); Cheers, Lincoln. _____________________________________________________________________________ Internet: sdalelt@cc.curtin.edu.au Voice: +61-9-459-4701 lincoln_dale@f627.n690.z3.fidonet.org FidoNet: Lincoln Dale @ 3:690/627.0 Data: +61-9-493-1534 PSImail: psi%050529452300070::sdalelt +61-9-493-2625 UUCP: uunet!munnari.oz!cc.curtin.edu.au!sdalelt Bitnet: sdalelt%cc.curtin.edu.au@cunyvm.bitnet