Quantcast
Channel: VMware Communities : Popular Discussions - VMware ThinApp: Discussion Forum
Viewing all articles
Browse latest Browse all 57744

ThinApp Script to terminate child processes

$
0
0

Working on virtualizing Quickbooks 2012 Premier with Eval version of ThinApp 4.7.

 

QB leaves 3 or 4 processes running after closing QB that consume too much RAM to keep running indefinitely in a Remote Desktop environment, so I'd like them to terminate along with QuickBooks. My experiments thus far show no ill effects from doing so, aside from longer QB load times. And it has the side-benefit of preventing background QB updates, which, here, is desireable.

 

I am including a VBScript with my package that works correctly outside the bubble, but does not work at all when run from the OnFirstParentExit callback. The relevant code follows:

 

Function OnFirstParentExit     Dim objWMIService     Dim colProcess     Dim objProcess     strComputer = "."     Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")     Set colProcess = objWMIService.ExecQuery("SELECT * FROM Win32_Process")     For Each objProcess in colProcess          If InStr(UCase(objProcess.Name), "QUICKBOOKS") > 0 Then               objProcess.Terminate          End If     Next
End Function

 

I've verified that closing QB does, in fact, run this procedure, by adding a Wscript.Echo statement.

 

Is it not possible to terminate these processes from a script within the bubble? If so, is there a way to have OnFirstParentExit run this procedure outside the bubble?

 

TIA


Viewing all articles
Browse latest Browse all 57744

Trending Articles