How To Stop Running COM+ Processes from Script

Summary

In Microsoft Windows NT 4.0, you can run MTXSTOP from a command prompt to stop all of the running Mtx.exe processes. Although an equivalent command is not available in COM+, this article describes how to create script that stops all of the running COM+ processes.

More Information

Step-by-Step Example

  1. In Notepad, create a new script file named Complusstop.vbs, and paste the following code:
        Dim oApplications 'As COMAdminCatalogCollection
    Dim oCatalog 'As COMAdminCatalog
    Dim oApp 'As COMAdminCatalogObject


    Set oCatalog = CreateObject("ComAdmin.COMAdminCatalog")
    Set oApplications = oCatalog.GetCollection("Applications")
    oApplications.Populate

    Wscript.Echo "Closing " & oApplications.Count & " applications."
    For Each oApp In oApplications
    'Must shut down system application last.
    If oApp.Name <> "System Application" Then
    Wscript.Echo "Shutting down " & oApp.Name
    Call oCatalog.ShutdownApplication(oApp.Name)
    End If
    Next 'oApp
    Wscript.Echo "Shutting down System Application"
    Call oCatalog.ShutdownApplication("System Application")

    Wscript.Echo "Completed shutdown process. Exiting"

    Set oApp = Nothing
    Set oApplications = Nothing
    Set oCatalog = Nothing
  2. In Windows Explorer, double-click Complusstop.vbs to stop all the running COM+ (Dllhost.exe) processes.

References

For more information about the COMAdminCatalog object, see the following MSDN Web site:
Propiedades

Id. de artículo: 304713 - Última revisión: 24 mar. 2009 - Revisión: 1

Comentarios