Sign in to follow this  
Followers 0
jefhal

Loop dies at 60

24 posts in this topic

This is bizarre. I am doing a lookup of computer names in active directory to find where they are located. I paste a list of the file names into an edit box, convert the list to an array and then loop through the array looking up each computer and writing it and its location to a file. Whenever I reach the 60th computer, the loop hangs up and the program locks. What is going on???

;Program to find the location of computers based on their system names.
;Expect single computer, text file list, or drag and drop functionality.

#include <array.au3>
#include <DellRelatedFunctions.au3>
#include <constants.au3>
#include <INet.au3>
dim $pingreply[4] = ["Host is offline","Host is unreachable","Bad destination","Unknown error"]   
dim $out = "", $output = ""
dim $scope = '"ou=SHS",dc=SAU,dc=SPRIZE,dc=com'; for example
global $strComputer  
global $file
HotKeySet("{ESC}","_terminate")
Opt("TrayIconDebug", 1) 
GUICreate("Locate computers",500,700,300,200)
    $label1 = GUICtrlCreateLabel("Type or paste the list of computers from MVsoft PCbase here:",10,10,200,15)
    $EditBox = GUICtrlCreateEdit("",10,35,300,600,$ES_AUTOVSCROLL+$WS_VSCROLL+$ES_MULTILINE)
;GUICtrlSetState(1,$gui_acceptfiles)
    $GO = GUICtrlCreateButton("GO",320,35,100,35)
    $email = GUICtrlCreateCheckbox("Send results as email?",320,80,200,15)
    $label2 = GUICtrlCreateLabel("NOTE: Results are automatically stored in clipboard. Paste into any text box using CTRL-V",320,150,150,150)
GUISetState()
                FileDelete(@TempDir & "\FindRoomLocation.txt")
                $file = FileOpen(@TempDir & "\FindRoomLocation.txt", 1)
            ;MsgBox(1,"File Handle =",$file)
            ; Check if file opened for writing OK
                If $file = -1 Then
                MsgBox(0, "Error", "Unable to open file.")
                    Exit
                EndIf

while 1 ; Wait for user to select checkboxes and then press the "Go" button to begin routines
    $msg = guigetmsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE; If user closes the dialog box the program is ended
            FileClose(@TempDir & "\FindRoomLocation.txt")
            Exit
        Case $msg = $GO  
            $CollectionBox = GUICtrlRead(4)  
            $arCollectionBox = StringSplit($CollectionBox,@LF)
            _ArrayDisplay($arCollectionBox,"This is the array")
            
            for $i = 1 to $arCollectionBox[0]
            ;MsgBox(1,"array contents",$arCollectionBox[$i])
                $out = ""
                $pid = ""
            ;ToolTip("$arCollectionBox = " & StringStripCR($arCollectionBox[$i]))
            ;Sleep(1000)
                $strComputer = StringStripWS(StringRight($arCollectionBox[$i],StringInStr(StringStripCR($arCollectionBox[$i]),"  ","",-1)),8)
                ToolTip($strComputer)
            ;Sleep(1000)
            ; Get dn of current computer
                $pid = run(@comspec & " /c \\student2\apps$\_bin\utils\AdFind.exe -b " _
& $scope & ' -dn -f name=' & $strComputer,@TempDir,"",$stdout_child)
                While 1
                    $out &= StdoutRead($pid)
                    If @error = -1 Then ExitLoop
                    ;MsgBox(0, "STDOUT read:", $out)
                Wend    
                        ;MsgBox(0, "STDOUT read:", $out)
                if StringInStr($out,"1 Object") <> 0 Then               
                    $rightout = StringTrimLeft($out,StringInStr($out,"OU=")+2)
                        ;ToolTip("$rightout" & $rightout)
                        ;Sleep(1000)
                    $leftout = StringLeft($rightout,StringInStr($rightout,",",0,3)-1)
                        ;ToolTip("$leftout" & $leftout)
                        ;Sleep(1000)
                    $output = $strComputer & " is located in " & $leftout & @CRLF
                        ;ToolTip($output)
                        ;Sleep(1000)
                    FileWrite($file, $output)
                EndIf
                if StringInStr($out,"0 Objects") <> 0 Then 
                    $output = $strComputer & " is not listed in Active Directory" & @CRLF
                    FileWrite($file, $output)
                EndIf
            Next
                    ;MsgBox(64,"Locations of all computers listed: ",$output)
                    ;ClipPut($output)
            run("notepad " & @TempDir & "\FindRoomLocation.txt")
                FileClose(@TempDir & "\FindRoomLocation.txt")
            if GUICtrlRead($email) = 1 Then
                MsgBox(1,"Username=",@UserName)
                $Address = InputBox('Address', 'Enter the E-Mail address to send message to')
                $Subject = InputBox('Subject', 'Name of software that you are locating')
                $Body = $output
                MsgBox(0,'E-Mail has been opened','The E-Mail has been opened and process identifier for the E-Mail client is ' & _INetMail($address, $subject, $body))
            EndIf
            Exit
    EndSelect
WEnd

Func _terminate()
    Exit 0
EndFunc

Here's the computer list:

systems sys0001

systems sys0002

systems sys0003

systems sys0004

systems sys0005

systems sys0006

systems sys0007

systems sys0008

systems sys0009

systems sys0010

systems sys0011

systems sys0012

systems sys0013

systems sys0014

systems sys0015

systems sys0016

systems sys0017

systems sys0018

systems sys0019

systems sys0020

systems sys0021

systems sys0022

systems sys0023

systems sys0024

systems sys0025

systems sys0026

systems sys0027

systems sys0028

systems sys0029

systems sys0030

systems sys0031

systems sys0032

systems sys0033

systems sys0034

systems sys0035

systems sys0036

systems sys0037

systems sys0038

systems sys0039

systems sys0040

systems sys0041

systems sys0042

systems sys0043

systems sys0044

systems sys0045

systems sys0046

systems sys0047

systems sys0048

systems sys0049

systems sys0050

systems sys0051

systems sys0052

systems sys0053

systems sys0054

systems sys0055

systems sys0056

systems sys0057

systems sys0058

systems sys0059

systems sys0060

systems sys0061

systems sys0062

systems sys0063

systems sys0064

systems sys0065

systems sys0066

systems sys0067

systems sys0068

systems sys0069

systems sys0070

systems sys0071

systems sys0072

systems sys0073

systems sys0074

systems sys0075

systems sys0076

systems sys0077

systems sys0078

systems sys0079


...by the way, it's pronounced: "JIF"... Bob Berry --- inventor of the GIF format

Share this post


Link to post
Share on other sites



This is bizarre. I am doing a lookup of computer names in active directory to find where they are located. I paste a list of the file names into an edit box, convert the list to an array and then loop through the array looking up each computer and writing it and its location to a file. Whenever I reach the 60th computer, the loop hangs up and the program locks. What is going on???

;Program to find the location of computers based on their system names.
;Expect single computer, text file list, or drag and drop functionality.

#include <array.au3>
#include <DellRelatedFunctions.au3>
#include <constants.au3>
#include <INet.au3>
dim $pingreply[4] = ["Host is offline","Host is unreachable","Bad destination","Unknown error"]   
dim $out = "", $output = ""
dim $scope = '"ou=SHS",dc=SAU,dc=SPRIZE,dc=com'; for example
global $strComputer  
global $file
HotKeySet("{ESC}","_terminate")
Opt("TrayIconDebug", 1) 
GUICreate("Locate computers",500,700,300,200)
    $label1 = GUICtrlCreateLabel("Type or paste the list of computers from MVsoft PCbase here:",10,10,200,15)
    $EditBox = GUICtrlCreateEdit("",10,35,300,600,$ES_AUTOVSCROLL+$WS_VSCROLL+$ES_MULTILINE)
;GUICtrlSetState(1,$gui_acceptfiles)
    $GO = GUICtrlCreateButton("GO",320,35,100,35)
    $email = GUICtrlCreateCheckbox("Send results as email?",320,80,200,15)
    $label2 = GUICtrlCreateLabel("NOTE: Results are automatically stored in clipboard. Paste into any text box using CTRL-V",320,150,150,150)
GUISetState()
                FileDelete(@TempDir & "\FindRoomLocation.txt")
                $file = FileOpen(@TempDir & "\FindRoomLocation.txt", 1)
        ;MsgBox(1,"File Handle =",$file)
        ; Check if file opened for writing OK
                If $file = -1 Then
                MsgBox(0, "Error", "Unable to open file.")
                    Exit
                EndIf

while 1; Wait for user to select checkboxes and then press the "Go" button to begin routines
    $msg = guigetmsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE; If user closes the dialog box the program is ended
            FileClose(@TempDir & "\FindRoomLocation.txt")
            Exit
        Case $msg = $GO  
            $CollectionBox = GUICtrlRead(4)  
            $arCollectionBox = StringSplit($CollectionBox,@LF)
            _ArrayDisplay($arCollectionBox,"This is the array")
            
            for $i = 1 to $arCollectionBox[0]
        ;MsgBox(1,"array contents",$arCollectionBox[$i])
                $out = ""
                $pid = ""
        ;ToolTip("$arCollectionBox = " & StringStripCR($arCollectionBox[$i]))
        ;Sleep(1000)
                $strComputer = StringStripWS(StringRight($arCollectionBox[$i],StringInStr(StringStripCR($arCollectionBox[$i]),"  ","",-1)),8)
                ToolTip($strComputer)
        ;Sleep(1000)
        ; Get dn of current computer
                $pid = run(@comspec & " /c \\student2\apps$\_bin\utils\AdFind.exe -b " _
& $scope & ' -dn -f name=' & $strComputer,@TempDir,"",$stdout_child)
                While 1
                    $out &= StdoutRead($pid)
                    If @error = -1 Then ExitLoop
                ;MsgBox(0, "STDOUT read:", $out)
                Wend    
                    ;MsgBox(0, "STDOUT read:", $out)
                if StringInStr($out,"1 Object") <> 0 Then               
                    $rightout = StringTrimLeft($out,StringInStr($out,"OU=")+2)
                    ;ToolTip("$rightout" & $rightout)
                    ;Sleep(1000)
                    $leftout = StringLeft($rightout,StringInStr($rightout,",",0,3)-1)
                    ;ToolTip("$leftout" & $leftout)
                    ;Sleep(1000)
                    $output = $strComputer & " is located in " & $leftout & @CRLF
                    ;ToolTip($output)
                    ;Sleep(1000)
                    FileWrite($file, $output)
                EndIf
                if StringInStr($out,"0 Objects") <> 0 Then 
                    $output = $strComputer & " is not listed in Active Directory" & @CRLF
                    FileWrite($file, $output)
                EndIf
            Next
                ;MsgBox(64,"Locations of all computers listed: ",$output)
                ;ClipPut($output)
            run("notepad " & @TempDir & "\FindRoomLocation.txt")
                FileClose(@TempDir & "\FindRoomLocation.txt")
            if GUICtrlRead($email) = 1 Then
                MsgBox(1,"Username=",@UserName)
                $Address = InputBox('Address', 'Enter the E-Mail address to send message to')
                $Subject = InputBox('Subject', 'Name of software that you are locating')
                $Body = $output
                MsgBox(0,'E-Mail has been opened','The E-Mail has been opened and process identifier for the E-Mail client is ' & _INetMail($address, $subject, $body))
            EndIf
            Exit
    EndSelect
WEnd

Func _terminate()
    Exit 0
EndFunc

Here's the computer list:

have you tried removing the 60th computer, to see if it's the value causing issues, or if it's just the 60th iteration?

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

have you tried removing the 60th computer, to see if it's the value causing issues, or if it's just the 60th iteration?

Good idea, and yes, I did try that. I also used a different list of 60+ machines that were made up in Excel and it still dies. I then changed the select case method to if then method. Same thing. I now re-initialize all variables used in the loop each time the loop begins. I also ran the adfind command string outside of AutoIT in a batch file and it runs fine right through 80+ values. It has to be something about AutoIT that is limited by the number 60. I know that only 64 files can be open at once, so I close the file every time I write to it. I also found one comment in the help file that you can only make arrays up to 21 elements, but that's if you use arraycreate, not stringsplit.

The only other weird thing is that if I view the value of $out as it is generated, some of the machines near the end of the list will give no output. However, this did not happen when I used the batch file above.

Help! :P


...by the way, it's pronounced: "JIF"... Bob Berry --- inventor of the GIF format

Share this post


Link to post
Share on other sites

By the way, the code stops on line 65: "$out &= StdoutRead($pid)"


...by the way, it's pronounced: "JIF"... Bob Berry --- inventor of the GIF format

Share this post


Link to post
Share on other sites

Good idea, and yes, I did try that. I also used a different list of 60+ machines that were made up in Excel and it still dies. I then changed the select case method to if then method. Same thing. I now re-initialize all variables used in the loop each time the loop begins. I also ran the adfind command string outside of AutoIT in a batch file and it runs fine right through 80+ values. It has to be something about AutoIT that is limited by the number 60. I know that only 64 files can be open at once, so I close the file every time I write to it. I also found one comment in the help file that you can only make arrays up to 21 elements, but that's if you use arraycreate, not stringsplit.

The only other weird thing is that if I view the value of $out as it is generated, some of the machines near the end of the list will give no output. However, this did not happen when I used the batch file above.

Help! :P

i saw that comment once too, about 21 elements, don't remember where, but if you look at the language limits in the faq, it gives you a much more acceptable number...

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

This won't solve the problem at hand but this line is awfully suspicious:

$CollectionBox = GUICtrlRead(4)

I don't believe that a hard-coded number should ever be supplied as a control ID.

Could you please also consider trimming your code down a bit (e.g. getting rid of the GUI integration)? This will help in narrowing down the cause.

Share this post


Link to post
Share on other sites

This won't solve the problem at hand but this line is awfully suspicious:

$CollectionBox = GUICtrlRead(4)

I don't believe that a hard-coded number should ever be supplied as a control ID.

Could you please also consider trimming your code down a bit (e.g. getting rid of the GUI integration)? This will help in narrowing down the cause.

Thanks Alex. I will try changing the GuiCtrlRead line as the number can change with changes in the gui.... although if that number is wrong, the msgbox showing the entire array will have bogus values. I will try to narrow down the code as well by simply entering computer numbers rather than the strings that have to be parsed and trimmed. I've been hot and cold with the $stdout_child method of collecting output from run commands, so I'm also going to try using to output the run command to the clipboard, as I've done before and find out if $stdout_child is the culprit. Is there anything else in the code that would be opening 64 files and reaching that limitation?

Best, Jeff


...by the way, it's pronounced: "JIF"... Bob Berry --- inventor of the GIF format

Share this post


Link to post
Share on other sites

I don't believe that you are reaching any AutoIt limits because you would most likely receive an AutoIt error and the script would terminate.

You seem to open many processes during the life of the script (even though it doesn't appear that they overlap). Maybe one is opening and then getting stuck?

I don't believe that you need @ComSpec to launch ADFind either (at least while using StdOutRead()).

P.S. I found your thread title quite amusing -- like some sort of geek newspaper headline. :P

Share this post


Link to post
Share on other sites

I don't believe that you are reaching any AutoIt limits because you would most likely receive an AutoIt error and the script would terminate.

You seem to open many processes during the life of the script (even though it doesn't appear that they overlap). Maybe one is opening and then getting stuck?

I don't believe that you need @ComSpec to launch ADFind either (at least while using StdOutRead()).

P.S. I found your thread title quite amusing -- like some sort of geek newspaper headline. :P

Well, on my way to simplifying the code, I ended up exchanging the $stdout_child method for my old tried-and-true clipboard method and it worked. No matter how many computer names I pump into it, the process always completes. So..... I will try the old code with your suggestion of removing the @comspec and see if the helps. I still think that the internals of stdoutread have some issues. Earlier this year I ran into a problem when the size of the output of my run command was too large for stdoutread to entirely capture. It always stopped collecting at the same point (several hundred bytes from an ipconfig /all command). That was in combination with PSEXEC from sysinternals, so, again, not a clean issue to troubleshoot.

I'll post here again if I find anything more on ADFind and STDOUTREAD()...

Jeff

P.S. I used to work in advertising and headlines were the best part!


...by the way, it's pronounced: "JIF"... Bob Berry --- inventor of the GIF format

Share this post


Link to post
Share on other sites

so what do you want the script to do exactly?


[left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left]

Share this post


Link to post
Share on other sites

Well, on my way to simplifying the code, I ended up exchanging the $stdout_child method for my old tried-and-true clipboard method and it worked. No matter how many computer names I pump into it, the process always completes. So..... I will try the old code with your suggestion of removing the @comspec and see if the helps. I still think that the internals of stdoutread have some issues. Earlier this year I ran into a problem when the size of the output of my run command was too large for stdoutread to entirely capture. It always stopped collecting at the same point (several hundred bytes from an ipconfig /all command). That was in combination with PSEXEC from sysinternals, so, again, not a clean issue to troubleshoot.

I'll post here again if I find anything more on ADFind and STDOUTREAD()...

Jeff

P.S. I used to work in advertising and headlines were the best part!

Hey, jefhal;

I don't see anything wrong with your code, though I've never used a "" in a Run function for the "show" parameter. Anyway, if there's a problem with StdoutRead of course the devs (me especially) want to know. My problem for doing a 1:1 troubleshoot is that I don't have access to an AD network. I might be able to fake it from work if ADFind works with eDirectory, but I can't find any indicator if it does.

So, if we may know: what version of Windows are you running the script on? What version of the AutoIt beta are you using? There was a change in beta 3.1.1.88 that affects the StdxxxYyy functions, if you need an older beta version for testing I can come up with one. When the script stops it's "frozen", there's no response from the tray icon? You'd get that if there was no output forthcoming from ADFind and you tried to read from it... there's not any kind of chance that ADFind is prompting for input in this one case? Will the script start up again if you kill the ADFind process from the Task Manager when the script freezes?

Let us know, if you get the opportunity...


Yes yes yes, there it was. Youth must go, ah yes. But youth is only being in a way like it might be an animal. No, it is not just being an animal so much as being like one of these malenky toys you viddy being sold in the streets, like little chellovecks made out of tin and with a spring inside and then a winding handle on the outside and you wind it up grrr grrr grrr and off it itties, like walking, O my brothers. But it itties in a straight line and bangs straight into things bang bang and it cannot help what it is doing. Being young is like being like one of these malenky machines.

Share this post


Link to post
Share on other sites

Hey, jefhal;

I don't see anything wrong with your code, though I've never used a "" in a Run function for the "show" parameter. Anyway, if there's a problem with StdoutRead of course the devs (me especially) want to know. My problem for doing a 1:1 troubleshoot is that I don't have access to an AD network. I might be able to fake it from work if ADFind works with eDirectory, but I can't find any indicator if it does.

So, if we may know: what version of Windows are you running the script on? What version of the AutoIt beta are you using? There was a change in beta 3.1.1.88 that affects the StdxxxYyy functions, if you need an older beta version for testing I can come up with one. When the script stops it's "frozen", there's no response from the tray icon? You'd get that if there was no output forthcoming from ADFind and you tried to read from it... there's not any kind of chance that ADFind is prompting for input in this one case? Will the script start up again if you kill the ADFind process from the Task Manager when the script freezes?

Let us know, if you get the opportunity...

Hi DaveF- Thanks for your interest. Here's an abbreviated version of the script with some of the things I've tried commented out:

#include <array.au3>
#include <DellRelatedFunctions.au3>
#include <constants.au3>
#include <INet.au3>
HotKeySet("{ESC}","_terminate")
Opt("TrayIconDebug", 1) 
dim $out = "", $output = ""

MsgBox(17,"WARNING!","When this hangs up you will have to use PSKILL or TASKMANAGER to stop the program")

For $i = 1 to 80
    $strComputer = "sys00" & $i
$pid = run('AdFind.exe -b "ou=SHS",dc=SAU,dc=sprize,dc=com -dn -f name=' & $strComputer,@TempDir,"",$stdout_child)
;MsgBox(17,"$Pid",$pid)
;sleep(1000)
;$out = ""
    While 1
        $out &= StdoutRead($pid)
        If @error = -1 Then ExitLoop
    ;MsgBox(0, "STDOUT read:", $out)
    Wend    
;run('pskill.exe -t ' &$pid,@tempdir,"",@sw_hide)
;MsgBox(0, "STDOUT read:", $out)
    $rightout = StringTrimLeft($out,StringInStr($out,"OU=")+2)
;MsgBox(1,"$rightout",$rightout)
    $leftout = StringLeft($rightout,StringInStr($rightout,",",0,3)-1)
;MsgBox(1,"$leftout",$leftout)
    $output = $strComputer & " is located in " & $leftout
    ToolTip($output)
    $pid = ""
Next

Func _terminate()
    exit 0
EndFunc

I'm running this on WindowsXP Pro, Dell 2.X GHz machine, 512MB ram, Running: (3.1.1.75) beta, When it freezes the tray icon (which is in debug mode) says that it was last on the line:

$pid = run('AdFind.exe -b "ou=SHS",dc=SAU,dc=sprize,dc=com -dn -f name=' & $strComputer,@TempDir,"",$stdout_child)
.

Finally, when it dies, ADFIND is no longer in the process list. That probably means it finished that loop and the program is hanging up when it gets to the next lines:

While 1
        $out &= StdoutRead($pid)
        If @error = -1 Then ExitLoop
    ;MsgBox(0, "STDOUT read:", $out)
    Wend

Hope this helps! Jeff


...by the way, it's pronounced: "JIF"... Bob Berry --- inventor of the GIF format

Share this post


Link to post
Share on other sites

I had a simular problem a while ago when using FileRead(). I didn't increase the number of charactors to read as the file grew in size.

Looking at your script, I have the idea of using ADfind to create a text file of the computer names then use ReadLine() against the text file; pulling the information you want and dumping it into another text file.

by the way, I'm not familiar with ADfind.exe. What does this thingy do?

Share this post


Link to post
Share on other sites

I had a simular problem a while ago when using FileRead(). I didn't increase the number of charactors to read as the file grew in size.

Looking at your script, I have the idea of using ADfind to create a text file of the computer names then use ReadLine() against the text file; pulling the information you want and dumping it into another text file.

by the way, I'm not familiar with ADfind.exe. What does this thingy do?

Hi PerryRaptor-

ADFind is from Joeware and is a very useful tool for looking up things in Active Directory. In my case, we put all computers from each room into a single OU. Therefore, if I want to know where a specific computer is, I just use ADFind to return the OU of the computer and it tells me.

As to your idea of putting the results of ADFind into a text file, I do sort of the same thing using another freeware program called CLIPBOARD. Clipboard lets me send the output of ADFind to the clipboard, and the I use getclip() in AutoIT to retrieve the results. It saves me having to open and close a text file.

However, I'd prefer to do the whole thing in native AutoIT code using Stdoutread, but so far, I've had a number of "gotchas" with that method.

Thanks!


...by the way, it's pronounced: "JIF"... Bob Berry --- inventor of the GIF format

Share this post


Link to post
Share on other sites

Thanks for the info about ADFind...I've been searching about it on the net; rather interesting AD utility.

Another idea...Instead of using text files how about using a 2-dimensional Array?

It would be nice if we could do this natively within AutoIT...LDAP.au3 include file to handle ADSI/LDAP directly...I'll keep my hopes up that a Dev will build it one day.

- Enumerate numerous groups in nested organizational units:

// language == JScript

var oConn = new ActiveXObject("ADODB.Connection");

oConn.Provider = "ADSDSOObject";

oConn.Open("ADs Provider");

var oRs = oConn.Execute(";(LDAP QUERY");

while (!oRs.Eof)

{

var oUser = GetObject(oRs.Fields("ADsPath").Value);

WScript.Echo(oUSer.Members);

oRs.MoveNext();

}

oConn.Close();

- Bind to the group using the LDAP provider and enumerate members of a single group in a single organizational unit.

//language == JScript

var obj = GetObject_("LDAP://CN=MyUsers,CN=Users,DC=CTR1,DC=root01,DC=org");

mList = new Enumerator(obj);

for (; !mList.atEnd(); mList.moveNext())

{

s = mList.item();

WScript.Echo(s.Members);

}

Share this post


Link to post
Share on other sites

I'm running this on WindowsXP Pro, Dell 2.X GHz machine, 512MB ram, Running: (3.1.1.75) beta, When it freezes the tray icon (which is in debug mode) says that it was last on the line:

$pid = run('AdFind.exe -b "ou=SHS",dc=SAU,dc=sprize,dc=com -dn -f name=' & $strComputer,@TempDir,"",$stdout_child)<!--c2--></div><!--ec2-->. 
Finally, when it dies, ADFIND is no longer in the process list. That probably means it finished that loop and the program is hanging up when it gets to the next lines: <!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->While 1
        $out &= StdoutRead($pid)
        If @error = -1 Then ExitLoop
   ;MsgBox(0, "STDOUT read:", $out)
    Wend

Hope this helps! Jeff

Thanks for the information. Changes were made that affected StdoutRead after beta 3.1.1.88, so I'd really be interested to see if recompiling with the current beta changes the behavior that you're seeing.

For clarification: when the script fails is the tray icon responsive or not; can you right-click and choose Exit or does the right-click seemingly do nothing? If you get the right-click menu then it is likely that your While loop around StdoutRead is never exiting, if you get no right-click menu then it would seem that StdoutRead is waiting in vain for output from ADFind, leaving the AutoIt process blocked (suspended).


Yes yes yes, there it was. Youth must go, ah yes. But youth is only being in a way like it might be an animal. No, it is not just being an animal so much as being like one of these malenky toys you viddy being sold in the streets, like little chellovecks made out of tin and with a spring inside and then a winding handle on the outside and you wind it up grrr grrr grrr and off it itties, like walking, O my brothers. But it itties in a straight line and bangs straight into things bang bang and it cannot help what it is doing. Being young is like being like one of these malenky machines.

Share this post


Link to post
Share on other sites

Well, a little setback. I noticed that Scite was using the wrong Beta, even though I had updated, so, I uninstalled AutoIT. It erased one year of my work!

I'll check back in on Monday (assuming our daily backup worked) and let you know about the newest beta version with my original script.


...by the way, it's pronounced: "JIF"... Bob Berry --- inventor of the GIF format

Share this post


Link to post
Share on other sites

Now it gets stranger! If I run the script above using Scite and beta 97, it fails. BUT, if I run the same script using "C:\Program Files\AutoIt3\beta\AutoIt3.exe", the script RUNS! Yoiks. I'm now entirely baffled...


...by the way, it's pronounced: "JIF"... Bob Berry --- inventor of the GIF format

Share this post


Link to post
Share on other sites

If you ever have a question about which EXE (or compiled stub) is really running a script you can use the @AutoItVersion macro in a debug MsgBox or whatever to see the version.


Yes yes yes, there it was. Youth must go, ah yes. But youth is only being in a way like it might be an animal. No, it is not just being an animal so much as being like one of these malenky toys you viddy being sold in the streets, like little chellovecks made out of tin and with a spring inside and then a winding handle on the outside and you wind it up grrr grrr grrr and off it itties, like walking, O my brothers. But it itties in a straight line and bangs straight into things bang bang and it cannot help what it is doing. Being young is like being like one of these malenky machines.

Share this post


Link to post
Share on other sites

If you ever have a question about which EXE (or compiled stub) is really running a script you can use the @AutoItVersion macro in a debug MsgBox or whatever to see the version.

Hi DaveF-

The bad thing was that both were version 97. If I ran it through Scite it failed. If I ran it through START>PROGRAMS>AUTOIT3>BETA>RUNSCRIPT it worked... Why would this be different?


...by the way, it's pronounced: "JIF"... Bob Berry --- inventor of the GIF format

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