Loading ...
Sorry, an error occurred while loading the content.

RE: [Clip] DOS Output

Expand Messages
  • Grant
    ... For non network commands you can use help ^!set %FileName%=^$GetTempFile$ ^!TextToFile ^%FileName% ^$getOutput( help dir )$ ^!wait ^!open ^%FileName% for
    Message 1 of 6 , Apr 30 4:00 PM
    • 0 Attachment
      > I'd like to use NTP to prepare text files of the help screens of some
      > DOS commands, say "netstat /?", and put them in "c:my documents".
      > Could someone please write me an example of how to do this?

      For non network commands you can use help

      ^!set %FileName%=^$GetTempFile$
      ^!TextToFile "^%FileName%" ^$getOutput("help dir")$
      ^!wait
      ^!open ^%FileName%

      for a complete list of commands

      ^!set %FileName%=^$GetTempFile$
      ^!TextToFile "^%FileName%" ^$getOutput("help")$
      ^!wait
      ^!open ^%FileName%

      How ever The above does not work for the networK commands

      "Help Provides online information about Windows 2000 commands (non-network).
      "

      the net comands syntax is a bit different
      net help [cmd]

      ^!set %FileName%=^$GetTempFile$
      ^!TextToFile "^%FileName%" ^$getOutput("net help statistics")$
      ^!wait
      ^!open ^%FileName%

      To run cmd

      ^!set %FileName%=^$GetTempFile$
      ^!TextToFile "^%FileName%" ^$getOutput("net statistics")$
      ^!wait
      ^!open ^%FileName%

      However I could not get The netstat command to display help
      Although it did at the command prompt

      The following netstat output clearly works though

      ^!set %FileName%=^$GetTempFile$
      ^!TextToFile "^%FileName%" ^$getOutput(netstat -p tcp)$
      ^!wait
      ^!open ^%FileName%

      So What's going on? Ok read Alan c post and try capturing std err

      ^!set %FileName%=^$GetTempFile$
      ^!TextToFile "^%FileName%" ^$GetOutput(netstat /?)$
      ^!wait
      ^!open ^%FileName%
      ^!Open ^$GetStdErrorName$

      Ok StdError got it but why is this happening?
      Are we seeing the same inconsistency we saw in the perl discussion a while
      back?
    • Tom
      you ll need to remove the double quotes around the ^$getOutput argument in order for the suggested clips to work. e.g.: ^!TextToFile ^%FileName%
      Message 2 of 6 , Jul 1, 2001
      • 0 Attachment
        you'll need to remove the double quotes around the ^$getOutput
        argument in order for the suggested clips to work. e.g.:

        ^!TextToFile "^%FileName%" ^$getOutput(help dir)$
        ^!TextToFile "^%FileName%" ^$getOutput(help)$

        cheers,
        tom

        --- In ntb-clips@y..., "Grant" <emerge@p...> wrote:
        >
        > > I'd like to use NTP to prepare text files of the help screens of
        some
        > > DOS commands, say "netstat /?", and put them in "c:my documents".
        > > Could someone please write me an example of how to do this?
        >
        > For non network commands you can use help
        >
        > ^!set %FileName%=^$GetTempFile$
        > ^!TextToFile "^%FileName%" ^$getOutput("help dir")$
        > ^!wait
        > ^!open ^%FileName%
        >
        > for a complete list of commands
        >
        > ^!set %FileName%=^$GetTempFile$
        > ^!TextToFile "^%FileName%" ^$getOutput("help")$
        > ^!wait
        > ^!open ^%FileName%

        ~~ snip ~~
      • Tom
        oops! CORRECTION: you ll need to use ^$GetDosOutput instead of ^$GetOutput in order for the suggested clips to work. e.g.: ^!TextToFile ^%FileName%
        Message 3 of 6 , Jul 1, 2001
        • 0 Attachment
          oops! CORRECTION: you'll need to use ^$GetDosOutput instead of
          ^$GetOutput in order for the suggested clips to work. e.g.:

          ^!TextToFile "^%FileName%" ^$GetDosOutput(help dir)$
          ^!TextToFile "^%FileName%" ^$GetDosOutput(help)$

          quotes are optional. sorry about that, i even confused myself :|.

          cheers,
          tom

          --- In ntb-clips@y..., "Tom" <tom_xyz@y...> wrote:
          > you'll need to remove the double quotes around the ^$getOutput
          > argument in order for the suggested clips to work. e.g.:
          >
          > ^!TextToFile "^%FileName%" ^$getOutput(help dir)$
          > ^!TextToFile "^%FileName%" ^$getOutput(help)$
          >
          > cheers,
          > tom

          ~~ snip ~~
        • Grant
          ... Hi Tom How did this come out of the ether. If my memory serves me right I think I originally answered a question in relation to win2k network commands .
          Message 4 of 6 , Jul 1, 2001
          • 0 Attachment
            > oops! CORRECTION: you'll need to use ^$GetDosOutput instead of
            > ^$GetOutput in order for the suggested clips to work. e.g.:
            >
            > ^!TextToFile "^%FileName%" ^$GetDosOutput(help dir)$
            > ^!TextToFile "^%FileName%" ^$GetDosOutput(help)$
            >
            > quotes are optional. sorry about that, i even confused myself :|.

            Hi Tom
            How did this come out of the ether.

            If my memory serves me right I think I originally answered a question in
            relation to win2k 'network' commands .
            Using ^$getOutput()$ works in a nt4 or win2k environment , you might have
            to resort to using ^$getDosOutput()$ with
            as inferior ;) operating systems , I don't know?

            There is however a problem with ^$GetOutput()$ in certain circumstances
            where output goes to stdERR instead of stdOut
            which I hope Eric can resolve..

            Captures stdOut ok

            ^!set %FileName%=^$GetTempFile$
            ^!TextToFile "^%FileName%" ^$getOutput("netstat -p tcp")$
            ^!wait
            ^!open ^%FileName%

            Does not captures stdOut but goes to StdError instead.

            ^!set %FileName%=^$GetTempFile$
            ^!TextToFile "^%FileName%" ^$GetOutput(netstat /?)$
            ^!wait
            ^!open ^%FileName%
            ^!Open ^$GetStdErrorName$

            As a wild guess I would say it is something to do with "?" in the command
            prompt confusing the notetab parser
          Your message has been successfully submitted and would be delivered to recipients shortly.