Board index » delphi » Read DOS-Prog screen input

Read DOS-Prog screen input

Hi there!
Can anybody tell me how to use a dos-prog (swapvectors, exec (...),
swap...) without the prog give its message to the screen? For exaplme:

swapvectors;
exec ('command.com', '/c copy ....');
swapvectors;

so the copy-routine will give its message (german):
datei(en) werden kopiert...
command.com  (for example)
autoexec.bat     (for example)
config.sys         (for example)

how can I avoid this?
sky....@t-online.de

 

Re:Read DOS-Prog screen input


Quote
Luke Skywalker wrote:

> Hi there!
> Can anybody tell me how to use a dos-prog (swapvectors, exec (...),
> swap...) without the prog give its message to the screen? For exaplme:

> swapvectors;
> exec ('command.com', '/c copy ....');
> swapvectors;

> so the copy-routine will give its message (german):
> datei(en) werden kopiert...
> command.com  (for example)
> autoexec.bat     (for example)
> config.sys         (for example)

> how can I avoid this?
> sky....@t-online.de

Use exec('command.com', '/c copy .... >NUL');
                              add the ^^^^ to the above line
--
----------------------------------------------------------------
Donald Johnson                       bin...@jupiter.1starnet.com
Binary Engineers                              Software Developer
http://www.jupiter.1starnet.com/binary
----------------------------------------------------------------

Re:Read DOS-Prog screen input


In article <5jv26e$ak...@news01.btx.dtag.de> of Sun, 27 Apr 1997
08:19:25 in comp.lang.pascal.borland, Luke Skywalker <Sky.Net@t-

Quote
online.de> wrote:
>Can anybody tell me how to use a dos-prog (swapvectors, exec (...),
>swap...) without the prog give its message to the screen? For exaplme:

>swapvectors;
>exec ('command.com', '/c copy ....');
>swapvectors;

>so the copy-routine will give its message (german):
>datei(en) werden kopiert...
>command.com  (for example)
>autoexec.bat     (for example)
>config.sys         (for example)

>how can I avoid this?

Try, at the DOS prompt,
        C:\TEMP>copy nul nul
        C:\TEMP>copy nul nul > nul

Then consider
        exec ('command.com', '/c copy .... > nul') ;
AFAIR & AFAICS, this will suppress normal messages but not error
messages.
--
John Stockton, Surrey, UK.    j...@merlyn.demon.co.uk    Turnpike v1.12    MIME.
  Web URL: http://www.merlyn.demon.co.uk/ -- includes FAQqish topics and links.
  Correct 4-line sig separator is as above, a line comprising "-- " (SoRFC1036)
  Before a reply, quote with ">" / "> ", known to good news readers (SoRFC1036)

Re:Read DOS-Prog screen input


On 27 Apr 1997 08:19:25 GMT, Sky....@t-online.de (Luke Skywalker) wrote:

Quote
> Can anybody tell me how to use a dos-prog (swapvectors, exec (...),
> swap...) without the prog give its message to the screen? For exaplme:

> swapvectors;
> exec ('command.com', '/c copy ....');
> swapvectors;

As long as the called program is writing to stdout, it should be
possible to simply direct output to the nul device:

exec ('command.com', '/c copy ..... >nul');

Disclaimer: I did not try it.

Kurt
--
  K...@pinboard.com      http://www.pinboard.com/        business
                         http://www.pinboard.com/kurt/   private

Re:Read DOS-Prog screen input


Quote
Kurt Keller wrote:
> On 27 Apr 1997 08:19:25 GMT, Sky....@t-online.de (Luke Skywalker) wrote:

> > Can anybody tell me how to use a dos-prog (swapvectors, exec (...),
> > swap...) without the prog give its message to the screen? For exaplme:

> > swapvectors;
> > exec ('command.com', '/c copy ....');
> > swapvectors;

> As long as the called program is writing to stdout, it should be
> possible to simply direct output to the nul device:

> exec ('command.com', '/c copy ..... >nul');

> Disclaimer: I did not try it.

Well it's technically correct (though an error message may write to
stderr).  COMMAND.COM doesn't support redirecting stderr, but *can* be
redirected using 4DOS/NDOS with >& .

Over all, though, for something like the given example, it would be
easier to control by just writing the copy routine directly in TP using
the blockread() and blockwrite() procedures.  BTW, copy isn't an
external program, it's built into the command shell -- it's always been,
even since version 1.0.

Quote
> Kurt
> --
>   K...@pinboard.com      http://www.pinboard.com/        business
>                          http://www.pinboard.com/kurt/   private

--
Scott Earnest        | We now return you to our regularly |
set...@ix.netcom.com | scheduled chaos and mayhem. . . .  |

Other Threads