Sign in to follow this  
Followers 0
mikeytown2

Problem with Run $STDOUT

5 posts in this topic

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?

Share this post


Link to post
Share on other sites



I dont crash :) Gives my hostname fine and pure


Start here if you are new Valuater's AutoIT 1-2-3Looking for an UDF - Look hereDo you need to do it twice - Autoit

Share this post


Link to post
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!

Share this post


Link to post
Share on other sites

Mine is 7.0 though i can test it in the 6 later


Start here if you are new Valuater's AutoIT 1-2-3Looking for an UDF - Look hereDo you need to do it twice - Autoit

Share this post


Link to post
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
Sign in to follow this  
Followers 0