Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Script likes to throw Unhandled Exception Error

Status
Not open for further replies.

dean12

MIS
Oct 23, 2001
273
US

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
 
a windows process requiring the use of dllhost.exe is running at the time you shutdown the COM.

-Geates

"I hope I can feel and see the change - stop the bleed inside a feel again. Cut the chain of lies you've been feeding my veins; I've got nothing to say to you!"
-Infected Mushroom

"I do not offer answers, only considerations."
- Geates's Disclaimer
 
Maybe but I don't think so. Besides, I can go and right click on the thing and select 'shutdown' and I don't get an error.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top