How to script DOS app that doesn't use stdout

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Gregor

    #1

    How to script DOS app that doesn't use stdout

    There's a DOS console application I am trying to script (in Python), but it
    doesn't seem to use stdout or stderr... For example, if I redirect output
    to a file ("cmd > file.txt"), the output still appears on screen.
    Similarly, the output pipes returned by popen* don't catch the app's
    output. How might this app be generating its output? Any thoughts on how it
    could be captured (perhaps with something in the win32 extensions)?

    Thanks,

    Greg.
  • Paul Watson

    #2
    Re: How to script DOS app that doesn't use stdout

    "Gregor" <nospam@nospam. nospam.edu> wrote in message
    news:FMDWd.5829 95$6l.516471@pd 7tw2no...[color=blue]
    > There's a DOS console application I am trying to script (in Python), but
    > it
    > doesn't seem to use stdout or stderr... For example, if I redirect output
    > to a file ("cmd > file.txt"), the output still appears on screen.
    > Similarly, the output pipes returned by popen* don't catch the app's
    > output. How might this app be generating its output? Any thoughts on how
    > it
    > could be captured (perhaps with something in the win32 extensions)?[/color]

    The good-ole DOS app could be doing many things. It could be making BIOS
    calls or writing directly to the video display memory at segment 0xB800.
    One would think that if it did a DUP of stdout that it might get captured,
    but apparently you have tried the popen* family.

    Any hints as to what the DOS app is? If it is known by anyone, perhaps a
    workaround is also known.


    Comment

    • Gregor

      #3
      Re: How to script DOS app that doesn't use stdout

      > "Gregor" <nospam@nospam. nospam.edu> wrote in message[color=blue]
      > news:FMDWd.5829 95$6l.516471@pd 7tw2no...
      >[color=green]
      >> There's a DOS console application I am trying to script (in Python),
      >> but it
      >> doesn't seem to use stdout or stderr... For example, if I redirect
      >> output to a file ("cmd > file.txt"), the output still appears on
      >> screen. Similarly, the output pipes returned by popen* don't catch
      >> the app's output. How might this app be generating its output? Any
      >> thoughts on how it
      >> could be captured (perhaps with something in the win32 extensions)?[/color][/color]

      "Paul Watson" <pwatson@redlin epy.com> wrote in
      news:3920bqF5sv rudU1@individua l.net:
      [color=blue]
      > The good-ole DOS app could be doing many things. It could be making
      > BIOS calls or writing directly to the video display memory at segment
      > 0xB800. One would think that if it did a DUP of stdout that it might
      > get captured, but apparently you have tried the popen* family.
      >
      > Any hints as to what the DOS app is? If it is known by anyone,
      > perhaps a workaround is also known.[/color]

      Hmmm. Sounds like scripting this app might be a bit of a problem...

      I don't think the program was available to the general public... It's
      called "PC-Bill." It's used to send doctors' bills to the Canadian
      government.

      Greg.

      Comment

      • Timothy Grant

        #4
        Re: How to script DOS app that doesn't use stdout

        On Sun, 06 Mar 2005 13:41:57 GMT, Gregor <nospam@nospam. nospam.edu> wrote:[color=blue]
        > There's a DOS console application I am trying to script (in Python), but it
        > doesn't seem to use stdout or stderr... For example, if I redirect output
        > to a file ("cmd > file.txt"), the output still appears on screen.
        > Similarly, the output pipes returned by popen* don't catch the app's
        > output. How might this app be generating its output? Any thoughts on how it
        > could be captured (perhaps with something in the win32 extensions)?
        >
        > Thanks,
        >
        > Greg.[/color]

        I've had to do this a couple of times but never in recent years. I
        don't know your exact needs, but the best tool I ever found for this
        sort of job was called Phantom of the Keyboard.

        I ran into a couple of apps that I needed data out of and couldn't get
        it. They'd only output to screen, never to disk. I used Phantom to
        automate the app to dump data to screen and then capture the screen to
        disk.

        --
        Stand Fast,
        tjg.

        Comment

        • Gregor

          #5
          Re: How to script DOS app that doesn't use stdout

          Timothy Grant <timothy.grant@ gmail.com> wrote in
          news:mailman.11 1.1110305665.17 99.python-list@python.org :
          [color=blue]
          > On Sun, 06 Mar 2005 13:41:57 GMT, Gregor <nospam@nospam. nospam.edu>
          > wrote:[color=green]
          >> There's a DOS console application I am trying to script (in Python),
          >> but it doesn't seem to use stdout or stderr... For example, if I
          >> redirect output to a file ("cmd > file.txt"), the output still
          >> appears on screen. Similarly, the output pipes returned by popen*
          >> don't catch the app's output. How might this app be generating its
          >> output? Any thoughts on how it could be captured (perhaps with
          >> something in the win32 extensions)?
          >>
          >> Thanks,
          >>
          >> Greg.[/color]
          >
          > I've had to do this a couple of times but never in recent years. I
          > don't know your exact needs, but the best tool I ever found for this
          > sort of job was called Phantom of the Keyboard.
          >
          > I ran into a couple of apps that I needed data out of and couldn't get
          > it. They'd only output to screen, never to disk. I used Phantom to
          > automate the app to dump data to screen and then capture the screen to
          > disk.
          >[/color]

          Hmmm, interesting. I'll give that app a try. Thanks for the info.

          Greg.

          Comment

          • Harlin Seritt

            #6
            Re: How to script DOS app that doesn't use stdout

            "Phantom of the Keyboard" ... now that's a name!

            Comment

            Working...