Hi,

I am trying to uninstall uninstall Microsoft conferencing add-in for Microsoft office from sccm,  it needs to close outlook during process. kindly suggest the command line and how stop the process during instalaltion.

0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Answers

1

1. You can call vbscript/any other script to prompt user if outlook process is running .

2. Once step 1 is done you can continue with its uninstallation part.

 

If it has to be silent then in step 1 , execute the kill process script.

********************************************************************

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colProcessList = objWMIService.ExecQuery _
    ("Select * from Win32_Process Where Name = 'outlook.exe'")
count = 0
For Each objProcess in colProcessList
    count = count + 1
Next
Set WshShell = CreateObject("WScript.Shell")
Do While Count>=1
Msgbox "Please close the outlook to continue with the Upgrdation"
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colProcessList = objWMIService.ExecQuery _
    ("Select * from Win32_Process Where Name = 'outlook.exe'")
count = 0
For Each objProcess in colProcessList
    count = count + 1
Next
LOOP

*******************************************************************

 

Answered 01/02/2013 by: rock_star
Black Belt

Please log in to comment
1

You have to close Outlook gently with VBScript.. If you close it forcefully then it may prompt some error when the user launchs the outlook for the next time..

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.Session.Logoff
Outlook.Quit()
End If
Else
'MsgBox "Outlook is not running"

End If

 

 

Answered 01/03/2013 by: jagadeish
Red Belt

Please log in to comment
0

Tx. team for support

Answered 01/07/2013 by: rak_mcse
White Belt

Please log in to comment
Answer this question or Comment on this question for clarity