Announcement

Collapse

New Sub-Forum

In an effort to help make sure there are appropriate categories for topics of discussion that are happening, there is now a sub-forum for databases and database programming under Special Interest groups. Please direct questions, etc., about this topic to that sub-forum moving forward. Thank you.
See more
See less

shell

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • shell

    I have been using the shell feature in PBDOS to net use printers
    and copy files to printers ports. Examples.

    NET USE LPT1: \\MAIN\CHECK >NUL
    COPY /B Z:\CHECK.TXT LPT1: >NUL

    The >NUL is to discard any messages from the net use or copy.
    Without it you get message displayed on the screen

    We are trying to run the programs unders windows/nt/2000 and the
    >nul does not always pick up the message coming back.

    Is there any way around this, or should i just save the screen
    and restore it after the shell?



    ------------------

  • #2
    Output redirection only covers output that is sent to stdout, the standard DOS output
    device. It is also possible to redirect stderr, the standard DOS error output device,
    but some arcane twiddling is required. If output is being done in any other fashion,
    it will not generally be practical to intercept it. COPY probably only goes through
    stdout and stderr. What NET does may be another matter.

    In brief, you might be able to do it by redirecting stderr. Saving and restoring
    the screen would be a more general-purpose solution, though.

    ------------------
    Tom Hanlin
    PowerBASIC Staff

    Comment

    Working...
    X