hellAT Posted November 9, 2007 Share Posted November 9, 2007 Hello, has anyone an idea the get the (current) name of the network interface? That's what you can see by "ipconfig"... /Karsten Link to comment Share on other sites More sharing options...
schilbiz Posted November 9, 2007 Share Posted November 9, 2007 If what you are asking is to see the "ipconfig" information you can try this out. Global $IpconfigOutputOnce $ipconfig_output = Run(@ComSpec & " /c ipconfig /all", '', @SW_HIDE, 2) While 1 $ipconfig_data = StdoutRead($ipconfig_output) If @error Then ExitLoop If $ipconfig_data Then $IpconfigOutputOnce &= $ipconfig_data Else Sleep(10) EndIf WEnd $IpconfigOutputOnce = StringStripWS($IpconfigOutputOnce, 7) MsgBox(0, "IPCONFIG /ALL", $IpconfigOutputOnce) Link to comment Share on other sites More sharing options...
hellAT Posted November 9, 2007 Author Share Posted November 9, 2007 okay, i thought there's something built-in autoit. But anyway, this helps, thanks! Link to comment Share on other sites More sharing options...
ACalcutt Posted November 9, 2007 Share Posted November 9, 2007 (edited) okay, i thought there's something built-in autoit. But anyway, this helps, thanks! I think it is also kept in the registry if i remember correctly. I made this a long time ago when i was trying to learn autoit http://www.techidiots.net/autoit-scripts/ipset.rar/view, But this basically does what the above post states (except with netsh) _RunDOS("netsh inter show interface > " & $tempfile) While 1 $text = FileReadLine($tempfile, $line) If @error = -1 Then ExitLoop If StringTrimRight(StringTrimLeft($text, 30), StringLen(StringTrimLeft($text, 30)) - 9) = "Dedicated" Then GUICtrlSetData($connections, StringTrimLeft($text, 47) & "|") EndIf $line = $line + 1 WEnd Edit Global $IpconfigOutputOnce $ipconfig_output = Run(@ComSpec & " /c ipconfig /all", '', @SW_HIDE, 2) While 1 $ipconfig_data = StdoutRead($ipconfig_output) If @error Then ExitLoop If $ipconfig_data Then $IpconfigOutputOnce &= $ipconfig_data Else Sleep(10) EndIf WEnd $IpconfigOutputOnce = StringStripWS($IpconfigOutputOnce, 7) MsgBox(0, "IPCONFIG /ALL", $IpconfigOutputOnce) I didn't know you could use StdoutRead to get the output of run...good to know :-) Edited November 9, 2007 by ACalcutt Andrew Calcutt Http://www.Vistumbler.net Http://www.TechIdiots.net Its not an error, its a undocumented feature 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