This would do it. Just change the name of the process (in this case I used outlook for testing) to the name of the XPSP2 setup process.
The actual UDF posting can be found here http://www.kixtart.org/ubbthreads/showfl...=true#Post82991
Code:
Break on
$pid= EnumProcess("OUTLOOK.EXE")
While $pid <> ""
$pid= EnumProcess("OUTLOOK.EXE")
Sleep 5
Loop
Function EnumProcess($exe, optional $terminate, optional $Computer)
Dim $winmgmts, $ExecQuery, $Process, $id
If NOT $computer
$computer=@wksta
EndIf
$winmgmts="winmgmts:{impersonationLevel=impersonate}!//$COMPUTER"
Select
Case Val($exe)>0
$ExecQuery="select * from Win32_Process where ProcessId='$exe'"
$GetObject=GetObject($winmgmts).ExecQuery($ExecQuery)
For Each $Process in $GetObject
If $terminate
$=$Process.Terminate
EndIf
$EnumProcess = $Process.name
Next
$GetObject=''
Case VarType($exe)=8
$ExecQuery="select * from Win32_Process where Name='$exe'"
$GetObject=GetObject($winmgmts).ExecQuery($ExecQuery)
For Each $Process in $GetObject
If $terminate
$=$Process.Terminate
EndIf
$id=$Process.ProcessId
$EnumProcess = "$Id" + "|" + "$EnumProcess"
Next
$EnumProcess=Left($EnumProcess,Len($EnumProcess)-1)
$GetObject=''
Case 1
Exit 1
EndSelect
EndFunction
_________________________
Mart
- Chuck Norris once sold ebay to ebay on ebay.