JohnLewis65
Technical User
I am trying to figure out a network issue at remote sites. I have a VBScript that will
Map a network drive.
Start wireshark and save the output to the mapped drive.
I then do pings and trace routes to inside & outside IPs and save it to mapped drive.
Then delete the mapped drive.
I am able to do each of the item listed above, but they are done one at a time. I would like to start my wireshark capture. While it is running I want to do my pings and trace routes. I also am having an issuse when I delete the mapped drive the pings and trace routes are still running and I get a cmd window that it can not delete the drive due to the fact that something is still accessing the drive.
Map a network drive.
Start wireshark and save the output to the mapped drive.
I then do pings and trace routes to inside & outside IPs and save it to mapped drive.
Then delete the mapped drive.
I am able to do each of the item listed above, but they are done one at a time. I would like to start my wireshark capture. While it is running I want to do my pings and trace routes. I also am having an issuse when I delete the mapped drive the pings and trace routes are still running and I get a cmd window that it can not delete the drive due to the fact that something is still accessing the drive.
Code:
Dim WshShell, ObjShell
Set ObjShell = Wscript.CreateObject("WScript.Shell")
Set WshShell = WScript.CreateObject("WScript.Shell")
Return = WshShell.Run("cmd /c net use k: \\ServerName\public", 0, true)
WScript.Sleep 8000
WshShell.Exec("C:\Program Files (x86)\Wireshark\wireshark -a duration:10 -H -k -Q -w k:\Network_Issue\WireShark")
Return = WshShell.Run("cmd /c ping 8.8.8.8 >k:\Network_Issue\ping_google.txt", 0, true)
Return = WshShell.Run("cmd /c ping 10.97.188.114 >k:\Network_Issue\ping_dhcp.txt", 0, true)
Return = WshShell.Run("cmd /c ping 10.97.188.100 >k:\Network_Issue\ping_dns.txt", 0, true)
Return = WshShell.Run("cmd /c ping 10.97.44.1 >k:\Network_Issue\ping_default_gateway.txt", 0, true)
Return = WshShell.Run("cmd /c tracert 8.8.8.8 >k:\Network_Issue\trace_route_google.txt", 0, true)
Return = WshShell.Run("cmd /c tracert 10.97.188.114 >k:\Network_Issue\trace_route_dhcp.txt", 0, true)
Return = WshShell.Run("cmd /c tracert 10.97.188.100 >k:\Network_Issue\trace_route_dns.txt", 0, true)
Return = WshShell.Run("cmd /c tracert 10.97.44.1 >k:\Network_Issue\trace_route_default_gateway.txt", 0, true)
WScript.Sleep 900000
Retrun = WshShell.Run("cmd /c net use k: /delete")