Jump to content

Problem with Run $STDOUT


Recommended Posts

Problem with Run $STDOUT

#include <INet.au3>
#include <Constants.au3>
$IP = _INetGetSource("http://dynupdate.no-ip.com/ip.php")
If @error Or $IP = "" Then
    $IP = "127.0.0.1"
EndIf

$RunPID = Run(@ComSpec & " /c nslookup " & $IP, "", @SW_HIDE, $STDOUT_CHILD)

$name = StringSplit(StdoutRead($RunPID), "Name:", 1)
If $name[0] > 1 Then
    $name = StringSplit($name[2], "Address:", 1)
    $name = StringStripWS($name[1], 8)
Else
    $name = "No Internet Connection"
EndIf

MsgBox(0, "", $name)

The MsgBox shows up but the program crashes on This Line

$RunPID = Run(@ComSpec & " /c nslookup " & $IP, "", @SW_HIDE, $STDOUT_CHILD)

Running:(3.2.2.0)

Any idea whats wrong?

Link to comment
Share on other sites

After Restarting, uninstalling and deleting the autoit3 dir and reinstalling autoit 3.2.2.0 and scite i still get the same error...

I figured out that this function

_INetGetSource() is causing Autoit to blowup on my box.

i do not get the error with this code.

#include <INet.au3>
#include <Constants.au3>
$IP = _GetIP()

$RunPID = Run(@ComSpec & " /c nslookup " & $IP, "", @SW_HIDE, $STDOUT_CHILD)

$name = StringSplit(StdoutRead($RunPID), "Name:", 1)
If $name[0] > 1 Then
    $name = StringSplit($name[2], "Address:", 1)
    $name = StringStripWS($name[1], 8)
Else
    $name = "No Internet Connection"
EndIf

MsgBox(0, $IP, $name)

This might be a bug with the dll call or my wininet.dll is cooked. Still running IE6 btw, cus most of the Internet still does and i need it for coding.

wininet.dll info

Size: 643 KB (658,944 bytes)

Full Version Info: 6.00.2900.3020 (xpsp_sp2_gdr.061023-0214)

Any help is appreciated!

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...