Jochem Posted February 12, 2009 Posted February 12, 2009 (edited) $close = ProcessWaitClose($process1, 1000) And ProcessWaitClose($process2, 1000) And ProcessWaitClose($process3, 1000) If $close = 1 Then $log = FileOpen($logpath & $logpathprog1 & $comptername & ".log", 1) FileWriteLine($log, "closed: " & @MDAY & "-" & @MON & " " & @HOUR & ":" & @MIN) FileClose($log) The AND operator is not working like this but is working more like OR. But I want just to write a log file if all the processes are close and not just one of them. Edited February 12, 2009 by Jochem
trancexx Posted February 12, 2009 Posted February 12, 2009 $close = ProcessWaitClose($process1, 1000) And ProcessWaitClose($process2, 1000) And ProcessWaitClose($process3, 1000) If $close = 1 Then $log = FileOpen($logpath & $logpathprog1 & $comptername & ".log", 1) FileWriteLine($log, "closed: " & @MDAY & "-" & @MON & " " & @HOUR & ":" & @MIN) FileClose($log) The AND operator is not working like this but is working more like OR. But I want just to write a log file if all the processes are close and not just one of them.Is this working as you expect it to (try changing parameters): $a = 1 $b = 1 $c = 0 $close = $a And $b And $c If $close Then ConsoleWrite(@MDAY & "-" & @MON & " " & @HOUR & ":" & @MIN & @CRLF) Else ConsoleWrite("! At least one is false." & @CRLF) EndIf ♡♡♡ . eMyvnE
BrettF Posted February 12, 2009 Posted February 12, 2009 $iPID_1 = Run ("notepad.exe") $iPID_2 = Run ("notepad.exe") $iPID_3 = Run ("notepad.exe") If (ProcessWaitClose ($iPID_1, 0)) AND (ProcessWaitClose ($iPID_2, 1000)) AND (ProcessWaitClose ($iPID_3, 1000)) Then MsgBox (0, "", "All Closed") EndIf Cheers, Brett Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version!
Jochem Posted February 12, 2009 Author Posted February 12, 2009 thanks a lot, this works greatly except if i implant it in my script, so I am making elsewhere an fault or wrong looping
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now