One of a set of tools we're offering as a way of saying thank you for being a part of the community.
Function IsProcessRunning( strServer, strProcess ) Dim Process, strObject IsProcessRunning = False strObject = "winmgmts://" & strServer For Each Process in GetObject( strObject ).InstancesOf( "win32_process" ) If UCase( Process.name ) = UCase( strProcess ) Then IsProcessRunning = True Exit Function End If Next End Function On Error Resume Next Dim strComputer, strProcess strProcess = "outlook.exe" strComputer = "." If( IsProcessRunning( strComputer, strProcess ) = True ) Then Set Outlook = GetObject(, "Outlook.Application") If Err = 0 Then Outlook.Quit() End If Else WScript.Echo "Process " & strProcess & " is NOT running on computer " & strComputer End If
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.