Visual Studio 2010

wdsmedia

Active member
  • Feb 14, 2009
    597
    60
    28
    I need to configure command button (visual studio 2010) to run below DOS commands

    I have 2 command buttons in the GUI

    Once I click the command button 1 it should ping & tracert for 2 IP addresses store the result in a text file in D drive.

    For the command button 2, it should run the same but for two different IPs. Also I need to configure progress bar for the two buttons. While executing the commands CMD window should not open. I used below but no result...Please advice

    Shell("cmd.exe /c ping xx.xx.xx.xx >> d:\x_stat.txt/")
    Shell("cmd.exe /c tracert xx.xx.xx.xx >> d:\x_stat.txt/")
    Shell("cmd.exe /c ping yy.yy.yy.yy >> d:\x_stat.txt/")
    Shell("cmd.exe /c tracert yy.yy.yy.yy >> d:\x_stat.txt/")
     

    wdsmedia

    Active member
  • Feb 14, 2009
    597
    60
    28
    mata penne liyala thiyana tika waradi wage......net eke thibila mee tika hamb aunaaa

    Private Sub CmdIpConfigAll_Click(sender As Object, e As EventArgs) Handles CmdIpConfigAll.Click
    Dim Command As String
    Command = "ipconfig /all"
    Shell("cmd /k" & Command, 1, True)
    End Sub



    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

    Dim Command0 As String
    Dim Command1 As String
    Dim Command2 As String
    Dim Command3 As String

    Command0 = "ipconfig /all"
    Command1 = "netstat -a"
    Command2 = "net user"
    Command3 = "ping www.google.com"

    Process.Start("cmd", String.Format("/k {0} & {1} & {2} & {3}", Command0, Command1, Command2, Command3))

    End Sub


    meeke deweni eka nan tikak galapenwa wage mage wadeta....eeth meeta adawala...
    Progress bar eka configure karanne kohomada meeta adaalawa....???

    Ee kiyanne eka ip ekakata ping wela tracert wela eka D eke text file ekakata save wenakan.