#include <Constants.au3>
Global $sStdOut = ""
Global $sStdErr = ""
DOS("ping 127.0.0.0")
Func DOS($iCommand,$iKey = "")
$Process = Run(@ComSpec & " /c " & $iCommand & $iKey, @SystemDir, @SW_HIDE, $STDOUT_CHILD)
While 1
$sStdOut = StdoutRead($Process) & @CRLF
If @error Then ExitLoop
$sStdOut = StringReplace($sStdOut, @CRLF, "")
$sStdOut = StringReplace($sStdOut, @CR & @CR, @CR)
$sStdOut = OemToChar($sStdOut)
ConsoleWrite($sStdOut)
WEnd
EndFunc
Func OemToChar($szSrc)
Local $placeholder
For $i = 0 To StringLen($szSrc)
$placeholder &= " "
Next
Local $lRetVal = DllCall("user32.dll", "long", "OemToChar", "str", $szSrc, "str", $placeholder)
If IsArray($lRetVal) And $lRetVal[0] = 1 Then
Return SetError(0, 0, $lRetVal[2])
EndIf
Return SetError(1, 0, "")
EndFunc