Radimus the FindPROC() solution works fine, but it doesnt give an output.. (my boss keeps changing / adding idears [Smile] )
outlook only needs to close when it wasnt open before..
code:
if outlook = open 
runscript
dont close
Else
start outlook
run script
close
endif

this is the idear...

this is radimus' idear but it doesnt have output.. (or im going blind)
is it easy to add or do i need another way?
code:
Function FindPROC($PROC,optional $COMPUTER, optional $terminate)
Dim $GetObject, $Select
If NOT $computer $computer=@wksta EndIf
$GetObject="winmgmts:{impersonationLevel=impersonate}!//$COMPUTER"
$Select="select * from Win32_Process where Name='$PROC'"
For Each $Process in GetObject("$GetObject").ExecQuery("$select")
If $terminate $Process.Terminate EndIf
$FindPROC=$Process.ProcessId
Next
EndFunction