Shelling... the 'system' command and 'Ping'

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

    Shelling... the 'system' command and 'Ping'

    I have the problem that shelling in vb.net is not working for me at this
    point.

    I am trying to make a graphical application to netsend (multiple) PCs on
    the network(notwork ) and to ping to check if they are online or not.

    code like:
    shell("ping bob >> ""C:\hello.txt" "",windowstate. hidden[or whatever],
    false)

    does not work... nor does:
    shell("ping bob >> C:\hello.txt",w indowstate.hidd en[or whatever], false)

    wheras that is a perfectly acceptable string to feed the command
    prompt...

    I have a C++ class tht runs the C 'system' command on that string, which
    works perfectly, but then i can't supress the console window, which
    raises its ugliness in an unacceptable manner.

    any help?

    1§ 1§

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
  • Chris Dunaway

    #2
    Re: Shelling... the 'system' command and 'Ping'

    On Fri, 27 Aug 2004 06:24:18 -0700, _IS_ - wrote:
    [color=blue]
    > code like:
    > shell("ping bob >> ""C:\hello.txt" "",windowstate. hidden[or whatever],
    > false)
    >
    > does not work... nor does:
    > shell("ping bob >> C:\hello.txt",w indowstate.hidd en[or whatever], false)
    >
    > wheras that is a perfectly acceptable string to feed the command
    > prompt...
    >[/color]

    Try using the Process.Start method to start ping and then you redirect the
    output stream to a file.

    --
    Chris

    dunawayc[AT]sbcglobal_lunch meat_[DOT]net

    To send me an E-mail, remove the "[", "]", underscores ,lunchmeat, and
    replace certain words in my E-Mail address.

    Comment

    • Herfried K. Wagner [MVP]

      #3
      Re: Shelling... the 'system' command and 'Ping'

      * _IS_ - <g04c3347@campu s.ru.ac.za> scripsit:[color=blue]
      > I have the problem that shelling in vb.net is not working for me at this
      > point.
      >
      > I am trying to make a graphical application to netsend (multiple) PCs on
      > the network(notwork ) and to ping to check if they are online or not.
      >
      > code like:
      > shell("ping bob >> ""C:\hello.txt" "",windowstate. hidden[or whatever],
      > false)
      >
      > does not work... nor does:
      > shell("ping bob >> C:\hello.txt",w indowstate.hidd en[or whatever], false)
      >
      > wheras that is a perfectly acceptable string to feed the command
      > prompt...[/color]

      <URL:http://dotnet.mvps.org/dotnet/samples/miscsamples/downloads/RedirectConsole .zip>

      --
      M S Herfried K. Wagner
      M V P <URL:http://dotnet.mvps.org/>
      V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

      Comment

      • _IS_ -

        #4
        Re: Shelling... the 'system' command and 'Ping'

        Thank you v helpful.

        1§ 1§

        *** Sent via Developersdex http://www.developersdex.com ***
        Don't just participate in USENET...get rewarded for it!

        Comment

        Working...