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

  • Thread starter Thread starter _IS_ -
  • Start date Start date
I

_IS_ -

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",windowstate.hidden[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§
 
code like:
shell("ping bob >> ""C:\hello.txt""",windowstate.hidden[or whatever],
false)

does not work... nor does:
shell("ping bob >> C:\hello.txt",windowstate.hidden[or whatever], false)

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

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

--
Chris

dunawayc[AT]sbcglobal_lunchmeat_[DOT]net

To send me an E-mail, remove the "[", "]", underscores ,lunchmeat, and
replace certain words in my E-Mail address.
 
* _IS_ - said:
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",windowstate.hidden[or whatever], false)

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

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top