RìggníX Posted March 9, 2007 Share Posted March 9, 2007 (edited) hi! a func that returns the subnet mask. should work with windows in every language..... sorry, made a mistake in the title of the thread SubnetMask, NOT default gatewayGetSubnetMask.au3 Edited March 14, 2007 by RìggníX greetz, RìggníXBiTrAtE.tk Link to comment Share on other sites More sharing options...
RìggníX Posted April 1, 2007 Author Share Posted April 1, 2007 erm, can an admin please change the title of this thread to "Subnet Mask UDF" and than delete this answer?? thx! greetz, RìggníXBiTrAtE.tk Link to comment Share on other sites More sharing options...
vanstyn Posted June 23, 2008 Share Posted June 23, 2008 I ran across this thread looking for a quick way to get the default gateway. I couldn't find it so I wrote it: This code will actually get the default gateway: MsgBox(0,"default gateway", _get_default_gateway()) Func _get_default_gateway() $output = _get_cmd_output("netstat -rn") $arr = StringSplit($output, "Default Gateway:", 1) $arr2 = StringSplit($arr[2], "=",1) Return StringReplace(StringStripWS($arr2[1],1), @LF, '') EndFunc Func _get_cmd_output($cmd) $cmd_timeout = 2000 $pid = Run($cmd,@WorkingDir,@SW_HIDE,2) $timer = TimerInit() while (ProcessExists($pid)) sleep(50) If TimerDiff($timer) > $cmd_timeout Then ProcessClose($pid) WEnd $output = StdoutRead($pid) Return StringStripCR($output) EndFunc Link to comment Share on other sites More sharing options...
Michel Claveau Posted June 24, 2008 Share Posted June 24, 2008 (edited) Hi! Don't run for me. But it's normal, because : - I have TWO gateways (it's some ROUTE statements who choose the gateway). - My Windows is Vista ; and Netsh changed few presentations of infos. - My Windows is in french, and some words are translated. Perso, for found the first (metric=1) gateway, I use : ipconfig /ALL | find "Passerelle" ("Passerelle" is the french translation for the english word "Gateway") @+ Edited June 24, 2008 by Michel Claveau Link to comment Share on other sites More sharing options...
Ibrahim Posted June 24, 2008 Share Posted June 24, 2008 Did any try my post for detecting gateway i posted earlierjust change the IncludesGateWay Detectorand The Gateway watcherNice Work RìggníX [font="Arial Black"]My Stuff[/font]UPnP Port Forwarding Final.GateWay InformationThe GateWay Watcher(detect speeofing)Rightclick Any file --->Hide/UnhideThe Tip WatcherA PanelShare WatcherThe Arp WatcherThe Online License Checker 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