להלן VBS
לא עושים START ו SHUTDOWN ל Component Services אלא ל Applications שנמצאים בתוכם. הסקריפט משתמש ב COM+ Admin dll ורץ מקומית בלבד.
On Error Resume Next ' if VB add a reference to COM+ 1.0 Admin Type Library. ' if VBS just declare this object without a type Dim oCatalog As COMAdmin.COMAdminCatalog Dim sName As String Set oCatalog = CreateObject("COMAdmin.COMAdminCatalog") sName = "the package name goes here" oCatalog.ShutdownApplication sName ' to start the app use this syntax 'oCatalog.StartApplication sName If Err.Number = 0 Then MsgBox sName & " has been shut down.", vbOKOnly + vbInformation Else Const cMsg = "Error 0x#ERR# trying to shut down #APP#. (#DESC#.)" Dim sMsg sMsg = Replace(cMsg, "#ERR#", Hex(Err.Number), 1, 1) sMsg = Replace(sMsg, "#APP#", sName, 1, 1) sMsg = Replace(sMsg, "#DESC#", Err.Description, 1, 1) MsgBox sMsg, vbOKOnly + vbInformation Err.Clear End If Set oCatalog = Nothing
מקווה שעזר. ------------- בברכה, אביעד א.