Hey,
[autoit]
; Funktioniert nicht
If ProcessExists($pid) Then
Do
ProcessClose($pid)
Until Not ProcessExists($pid)
EndIf
; Funktioniert
While 1
If ProcessExists($pid) Then
Do
ProcessClose($pid)
Until Not ProcessExists($pid)
ExitLoop 1
EndIf
WEnd
Ich hab festgestellt, dass wenn ich If ohne einer While-Schleife verwende nicht ausgeführt wird, während ShellExecuteWait und RunWait.
Also wenn ich jetzt Zb. IsoBuster silent installiere, möchte ich das wenn der Prozess "isobuster_toolbar.exe" exestiert sofort geschlosen, wird das funktioniert aber nur mit hilfe einer While Schleife, dieser Prozess startet nich irrgendwan sonder bevor SchellExecute zuende ist.
[autoit]$InstallDir = @ProgramFilesDir & "\IsoBuster"
[/autoit][autoit][/autoit][autoit]If ProcessExists("isobuster_toolbar.exe") Then
Do
ProcessClose("isobuster_toolbar.exe")
Until Not ProcessExists("isobuster_toolbar.exe")
EndIf
ShellExecuteWait("isobuster_all_lang.exe","/SILENT /NOCANCEL /DIR=" & '"' & $InstallDir & '"')
[/autoit]
Das geht eigenartigerweise nicht.
Nur so wird der Prozess beendet:
[autoit]$InstallDir = @ProgramFilesDir & "\IsoBuster"
[/autoit][autoit][/autoit][autoit]While 1
If ProcessExists("isobuster_toolbar.exe") Then
Do
ProcessClose("isobuster_toolbar.exe")
Until Not ProcessExists("isobuster_toolbar.exe")
ExitLoop 1
EndIf
WEnd
ShellExecuteWait("isobuster_all_lang.exe","/SILENT /NOCANCEL /DIR=" & '"' & $InstallDir & '"')
[/autoit]