Quantcast
Channel: VMware Communities : All Content - VMware® ThinApp®
Viewing all articles
Browse latest Browse all 1382

Need help for scripting in thinapp

$
0
0

Hi,

I am new to thinapp scripting.

 

In my thinapp package, i need to kill the process (Strategy Manager.exe) after shortcut exits. I have created vbscript kept it with package.ini and build the application by creating an MSI. Installed the MSI but when I launch the shortcut it doesn't launch and process gets exit. For reference please find below VBScript.

 

Function OnLastProcessExit
Option Explicit
Dim objWMIService, objProcess, colProcess
Dim strComputer, strProcessKill, strProcessKill1
strComputer = "."
strProcessKill = "'Strategy Manager.exe'"
strProcessKill1 = "'splwow64.exe'"

  
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\cimv2")

Set colProcess = objWMIService.ExecQuery _
("Select * from Win32_Process Where Name = " & strProcessKill )
For Each objProcess in colProcess
objProcess.Terminate()
Next
WSCript.Echo "Just killed process " & strProcessKill _
& " on " & strComputer

Set colProcess = objWMIService.ExecQuery _
("Select * from Win32_Process Where Name = " & strProcessKill1 )
For Each objProcess in colProcess
objProcess.Terminate()
Next
WSCript.Echo "Just killed process " & strProcessKill1 _
& " on " & strComputer

WScript.Quit

End Function

 

Can you please help me what's going wrong over here?

 

Appreciate the help.

 

Cheers,

Rhushikesh


Viewing all articles
Browse latest Browse all 1382

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>