It might be because the program is never reaching the $ping case. It checks the radio button and skips the rest
#include <GuiConstants.au3>
GUICreate("Ping Tool", 300, 300)
GUISetIcon(@SystemDir & "\mspaint.exe", 0)
; selection
GUISetFont(16, 400, 0, "Arial")
$radio = GUICtrlCreateGroup("Domain Controller:", 30, 20, 180, 100)
$radio1 = GUICtrlCreateRadio("CSCDC1", 50, 40, 120)
GUICtrlSetState(-1, $GUI_CHECKED)
$radio2 = GUICtrlCreateRadio("CSCDC2", 50, 80, 120)
GUICtrlCreateGroup("", -99, -99, 1, 1);close group
; create ping button
$ping = GUICtrlCreateButton("Ping!", 130, 250, 60, 35)
; GUI MESSAGE LOOP
GUISetState()
While 1
$msg = GUIGetMsg()
If GUICtrlRead($radio1) = $GUI_CHECKED Then
$ip = "novell.com"
Else
$ip = "yahoo.com"
EndIf
Select
Case $msg = $ping
ConsoleWrite("ping")
ConsoleWrite(@ComSpec & " /C Ping -a -n -1 " & $ip & " > Find_IP.txt")
RunWait(@ComSpec & " /C Ping -a -n -1 " & $ip & " > Find_IP.txt", @MyDocumentsDir, @SW_HIDE)
$ip = FileRead(@MyDocumentsDir & "\Find_IP.txt", FileGetSize(@MyDocumentsDir & "\Find_IP.txt"))
FileDelete(@MyDocumentsDir & "\Find_IP.txt")
MsgBox(0, "Returned Ping String [data]", "" & $ip)
; MsgBox(0,"" & $strcomputer & " IP:", "" & $ip)
EndSelect
If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd