Dev Posted March 21, 2004 Share Posted March 21, 2004 (edited) Okay, lets say I need a line to get amount of MS returned from this Batchline: Ping 127.0.0.1 Anyone knows how the AutoIt-code would look like? (or someone who can tip me if it exists in the helpfile). Thanks. oops! Next to forgot -> :iamstupid: Ps. Maybe its time to start the "Dev's n00by Questions"-topic? hehe Ds. Edited March 21, 2004 by Dev Link to comment Share on other sites More sharing options...
Developers Jos Posted March 21, 2004 Developers Share Posted March 21, 2004 have a look at this one to start your script... http://www.hiddensoft.com/forum/index.php?...ic=1482&hl=ping SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Dev Posted March 21, 2004 Author Share Posted March 21, 2004 (edited) Okay... but if i need to check if i have an established (right spelled?) connection with Netstat -n, and i dont want it to return more than the adress.If we say, that I make a function, CheckAddresViaPort($port), and if $port is 456, the function should return the ip adress connected to port 456, not the rest you get if you type "netstat -n | find "456" in CMDwin. Grr... I hate to be a n00b :postal::iamstupid:EDIT:Woho! At least the board says im not a Newbie anymore *points under his picture* Edited March 21, 2004 by Dev Link to comment Share on other sites More sharing options...
Developers Jos Posted March 21, 2004 Developers Share Posted March 21, 2004 (edited) Don't worry ... we have all been there at some point in time... what about something like this? RunWait(@comspec & " /c netstat -n >" & @tempdir &"\netstats.tmp","",@sw_hide) $file = FileOpen(@tempdir &"\netstat.tmp", 0) ; Check if file opened for reading OK If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf ; Read in lines of text until the EOF is reached While 1 $line = FileReadLine($file) If @error = -1 Then ExitLoop if StringInstr($line,":456") > 0 then msgbox(0,'found port 456' , $line) Wend FileClose($file) Edited March 21, 2004 by JdeB SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Dev Posted March 22, 2004 Author Share Posted March 22, 2004 (edited) Okay, Ill try it out, thanks for help EDIT: Tested I dont get it to work, it allways generates the error "Cannot open file.", I dont know why (Ive changed port to a port I know a program is using).Hope i dont need this soon --> :iamstupid: Edited March 22, 2004 by Dev Link to comment Share on other sites More sharing options...
Developers Jos Posted March 22, 2004 Developers Share Posted March 22, 2004 well thats because i made a typo..... First line says : \netstats.tmp and fileopen: \netstat.tmp Change the first line to: RunWait(@comspec & " /c netstat -n >" & @tempdir &"\netstat.tmp","",@sw_hide) SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Dev Posted March 22, 2004 Author Share Posted March 22, 2004 I think it works... at least it doesnt generate the error anymore. Thanks for help. :iamstupid: Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now