3 Replies - 1012 Views - Last Post: 22 November 2007 - 02:58 AM Rate Topic: -----

#1 bingy  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 79
  • View blog
  • Posts: 644
  • Joined: 15-December 06

Windows commands in code

Post icon  Posted 21 November 2007 - 11:35 AM

I am trying to create a program that will ping a URL constantly so that my dad's aircard will stay connected. I am not sure what I am doing wrong as the program executes but doesn't take into account the arguments.




Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
		Dim str As New ProcessStartInfo("c:\windows\system32\ping.exe")
		Process.Start(str)
		str.Arguments = "-t http://bingy.homeip.net"
	End Sub


Is This A Good Question/Topic? 0
  • +

Replies To: Windows commands in code

#2 Jayman  Icon User is offline

  • Student of Life
  • member icon

Reputation: 415
  • View blog
  • Posts: 9,532
  • Joined: 26-December 05

Re: Windows commands in code

Posted 21 November 2007 - 12:27 PM

Set the arguments before you start the process.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
		Dim str As New ProcessStartInfo("c:\windows\system32\ping.exe")
		str.Arguments = "-t http://bingy.homeip.net"
		Process.Start(str)
	End Sub

Was This Post Helpful? 0
  • +
  • -

#3 bingy  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 79
  • View blog
  • Posts: 644
  • Joined: 15-December 06

Re: Windows commands in code

Posted 21 November 2007 - 09:48 PM

Thank you Jayman you always seem to know how to help me out, LOL
Was This Post Helpful? 0
  • +
  • -

#4 RodgerB  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 66
  • View blog
  • Posts: 2,284
  • Joined: 21-September 07

Re: Windows commands in code

Posted 22 November 2007 - 02:58 AM

I made a VB.NET snippet a while back that I believe could help you, if all else fails.

http://www.dreaminco...snippet1327.htm

This post has been edited by RodgerB: 22 November 2007 - 02:59 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1