jlwilson
Member
I'm a beginner go easy on me! I've only completed VB.NET I in college. I am trying to write an application that will run an external command such as the following:
start "Pinging Host" 127.0.0.1 -t
The above is just an example (not really what I'm trying to ping). I can't figure out how to make my button execute the command. I performed a messagebox.show to display my command string to ensure that it was being read correctly. Then I tried to execute it by using the following code in my button:
Simplified Code below...
I don't know how to properly execute the string. I tried using Shell. Should I be doing this some other way?
The basic reason I'm even using "Start" is because I need the ping window to show which location is being pinged because often we have several windows open and it can get confusing without the window label.
Anyone have any ideas on what I'm doing wrong?
start "Pinging Host" 127.0.0.1 -t
The above is just an example (not really what I'm trying to ping). I can't figure out how to make my button execute the command. I performed a messagebox.show to display my command string to ensure that it was being read correctly. Then I tried to execute it by using the following code in my button:
Simplified Code below...
VB.NET:
[SIZE=2]
[/SIZE][SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] strCommandString [/SIZE][SIZE=2][COLOR=#0000ff]As [/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]String
[/COLOR][/SIZE][SIZE=2]strCommandString = [/SIZE][SIZE=2][COLOR=#800000]"start ""Pinging 127.0.0.1"" ping 127.0.0.1 -t"
[/COLOR][/SIZE][SIZE=2]MessageBox.Show(strCommandString, [/SIZE][SIZE=2][COLOR=#800000]"Output of strCommandString"[/COLOR][/SIZE][SIZE=2], MessageBoxButtons.OK, MessageBoxIcon.Information)
Shell(strCommandString)
[/SIZE]
I don't know how to properly execute the string. I tried using Shell. Should I be doing this some other way?
The basic reason I'm even using "Start" is because I need the ping window to show which location is being pinged because often we have several windows open and it can get confusing without the window label.
Anyone have any ideas on what I'm doing wrong?