Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!sdd.hp.com!hplabs!hpl-opus!hpcc05!hpyhde4!hpycla!hpcuhc!hpcupt3!defaria@hpcupt3.cup.hp.com From: defaria@hpcupt3.cup.hp.com (Andy DeFaria) Newsgroups: comp.lang.pascal Subject: Re: Redirecting I/O for .BAT files? Message-ID: <45670026@hpcupt3.cup.hp.com> Date: 26 Jun 91 18:01:26 GMT References: <45670020@hpcupt3.cup.hp.com> Organization: Hewlett Packard, Cupertino Lines: 34 >/ hpcupt3:comp.lang.pascal / Kai_Henningsen@ms.maus.de (Kai Henningsen) / 8:28 am Jun 24, 1991 / >Well, several comments. > >1. Do not use 'D:\COMMAND.COM', except if you try to call a *different* COMMAND >from the one that's your default. Use GetEnv('COMSPEC'). In my own version I did. In the version I posted I eliminated it for brievity and so that there was no mistake as to the actual file used. >2. You forgot to use /c for the first COMMAND. Yeah I know. I put it in. Same results. >3. You forgot to use SwapVectors. My shell program does this. My example didn't. I believe I put it into my example and tried it again without success. >So, try it like this: > >var > CommandCom: string; > > CommandCom := GetEnv('COMSPEC'); > SwapVectors; > Exec (CommandCom, '/c '+CommandCom+' /C C:\ANDY\FOO.BAT > FOO.OUT'); > SwapVectors; OK. I'll try it again - verbatim (plus a Program statement and the appropriate Begin/End's of course). Don't think it will work but I'll report it back to you. I have some questions though: Did *you* try this? Does it work for you? If so, what version of DOS/TP are you using. What is your chip (mine's an HP Classic Vectra 286 with DOS 3.3 and TP 6.0)?