I'm trying to make a simple program to display results of netstat....
I'm using the following code to run it...
Dim lfile As String
Private Sub mnuload_Click()
Shell "netstat -aenrs >>C:\netstat.txt", vbHide
lfile = "C:\netstat.txt"
stat.LoadFile lfile
End Sub
pretty simple code... just runs the command
netstat -aenrs >>C:\netstat.txt
and prints the results of netstat to a text file...
then loads that text file into a rich text box
though, my problem... is that when it runs the shell command, it opens another instance of my program (I had that code in Form_load before... and it just ran my program about a million times...
How can I get it to NOT run another instance of my program when running the shell command?
(it works fine without running my program again when I run it from inside VB, though not after compiled)
I'm using the following code to run it...
Dim lfile As String
Private Sub mnuload_Click()
Shell "netstat -aenrs >>C:\netstat.txt", vbHide
lfile = "C:\netstat.txt"
stat.LoadFile lfile
End Sub
pretty simple code... just runs the command
netstat -aenrs >>C:\netstat.txt
and prints the results of netstat to a text file...
then loads that text file into a rich text box
though, my problem... is that when it runs the shell command, it opens another instance of my program (I had that code in Form_load before... and it just ran my program about a million times...
How can I get it to NOT run another instance of my program when running the shell command?
(it works fine without running my program again when I run it from inside VB, though not after compiled)