So I've got this little VBScript that tries to shutdown a COM package. 100% of the time it does that. About 50% of the time it also throws up an error: "An unhandled win32 exception occurred in dllhost.exe [8616]." Then it wants me to go into the Visual Studio Just-In-Time Debugger.
I execute this script by saving it on the desktop and just double-clicking on it. Like I said it does the job but the error window is annoying and I cannot figure out why that happens. Sure would appreciate any thoughts:
option explicit
const LookForName = "Lifecycle Engine AppServer"
dim catalog, packages, i, n, util, packID, packName
on error resume next
set catalog = CreateObject("MTSAdmin.Catalog.1")
set packages = catalog.GetCollection("Packages")
packages.Populate
n = packages.count
for i = n - 1 to 0 step -1
packName = packages.Item(i).value("Name")
if packName = LookforName then
packID = packages.Item(i).value("ID")
set util = packages.GetUtilInterface
call util.ShutdownPackage(packID)
' msgbox "Located and shutdown " + packname + " " + packID
set util = Nothing
exit for
end if
next
set packages = nothing
set catalog = nothing