Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
outputfile = "C:\temp\Info.TXT" RunShell(Environment("comspec"),StrCat("/c netstat -e > ",outputfile),"", @NORMAL, @WAIT) ;Parse Output file ; Looking for line: ; Bytes 138189109 71163712 bytesrcvd = "" bytessent = "" contents = Fileget(outputfile) strptr = StrIndexNc (contents,"Bytes",1, @FWDSCAN) crlfptr = StrIndexNc (contents,@CRLF,strptr+1, @FWDSCAN) line = StrSub (contents, strptr, crlfptr-strptr) count = ItemCount(line," ") itemnum = 1 For x = 1 to count item = ItemExtract(x,line, " ") if item != "" if itemnum == 2 then bytesrcvd = item if itemnum == 3 then bytessent = item itemnum = itemnum+1 endif Next Message("Network Statistics",StrCat("Bytes Received: ",bytesrcvd,@crlf, "Bytes Sent: ",bytessent)) FileDelete(outputfile) exit
Article ID: W16699
File Created: 2005:02:18:12:21:54
Last Updated: 2005:02:18:12:21:54