What do you mean by "COM app". An EXE? A COM+ Application?
> Not sure where else to post this.... One of our developers quit and
> I'm taking over stuff from him.
[quoted text clipped - 5 lines]
>
> Any way to do that from a command line?
> > Not sure where else to post this.... One of our developers quit and
> > I'm taking over stuff from him.
[quoted text clipped - 5 lines]
>
> > Any way to do that from a command line?- Hide quoted text -
> What do you mean by "COM app". An EXE? A COM+ Application?
Sorry.
Yes, a COM+ Application.
Aidy - 30 Jul 2007 16:39 GMT
You could script it or make a small app to do it;
http://www.devx.com/vb2themax/Tip/19633
>> > Not sure where else to post this.... One of our developers quit and
>> > I'm taking over stuff from him.
[quoted text clipped - 11 lines]
>
> Yes, a COM+ Application.
Eric - 31 Jul 2007 21:24 GMT
using System;
using System.Collections;
using System.Collections.Specialized;
using COMAdmin; // This needs a reference to the "COM+ Admin" dll on
the COM tab
namespace xxx
{
class ShutdownCom
{
#region Get COM+ Applications
public StringCollection GetCOMApplications()
{
StringCollection collection = new StringCollection();
try
{
ICOMAdminCatalog objAdmin;
ICatalogCollection objCollection;
objAdmin = (ICOMAdminCatalog) new
COMAdmin.COMAdminCatalog();
objCollection = (ICatalogCollection)
objAdmin.GetCollection("Applications");
objCollection.Populate();
foreach(COMAdmin.COMAdminCatalogObject objApp in
objCollection)
{
collection.Add(objApp.Name.ToString());
// Console.WriteLine(objApp.Name.ToString());
}
}
catch(Exception ex)
{
Console.WriteLine("Error: " + ex.Message);
return null;
}
return collection;
}
#endregion
#region Shutting Down COM+ Application
public void ShutDownCOMApplication(string appName)
{
try
{
ICOMAdminCatalog objAdmin;
ICatalogCollection objCollection;
objAdmin = (ICOMAdminCatalog) new
COMAdmin.COMAdminCatalog();
objCollection = (ICatalogCollection)
objAdmin.GetCollection("Applications");
Console.WriteLine("Shutting down: " + appName);
objAdmin.ShutdownApplication(appName);
}
catch(Exception ex)
{
Console.WriteLine("Unable to shutdown the application, err=" +
ex.Message);
}
}
#endregion
[STAThread]
static void Main(string[] args)
{
// create an instance of our class
ShutdownCom shutdown = new ShutdownCom();
// shutdown all applications that begin with ZC
StringCollection appList = shutdown.GetCOMApplications();
foreach (string appName in appList)
{
if (appName.ToUpper().StartsWith("ZC"))
shutdown.ShutDownCOMApplication(appName);
}
}
}
}