Wise Script
I am deploying setup.exe using .iss file in system context. Installation starts but remains running because winword.exe is called by setup.exe and keep running.
I want check winword.exe after installation started if found then kill process and continue installation.
Please suggest how to do it using wisescript/vbscript?
thank in advance
Answers (3)
Function TaskKill(strTaskName)
Dim objWSH
Dim strTaskName
Dim shellCommand
Set objWSH = CreateObject("WScript.Shell")
shellCommand = "cmd /c taskkill /f /IM " & strTaskName & """"
objWSH.Run shellCommand, 0,true
End Function
Comments:
-
The script is in VBScript language. - terebent 11 years ago
-
Thanks for reply,
As per my understanding above script will first kill process and then start installation right? - Pravin 11 years ago -
My issues is that when i start installation then winword.exe gets run in background therefore installation gets pause.once i kill that process manually then only installation go ahead and finishes. - Pravin 11 years ago
-
Are you trying to install a MSI package or a exe? - terebent 11 years ago
-
exe - Pravin 11 years ago
-
Can you tell us the name of this app? This is strange launching a Winword at the background using a silent command. - dj_xest 11 years ago
-
Oracle BIPublisher Desktop 10.1.3.4.2 - Pravin 11 years ago
Run the following hta script separately while installing:
<html>
<head>
<title>ATTENTION</title>
<HTA:APPLICATION
ID="objAutoRefresh"
APPLICATIONNAME="Winword killer"
SCROLL="no"
SINGLEINSTANCE="no"
WINDOWSTATE="minimize"
BORDER=none
>
</head>
<SCRIPT LANGUAGE="VBScript">
Set wshShell = CreateObject("WScript.shell")
set filesys= CreateObject("Scripting.FileSystemObject")
Sub Window_OnLoad
iTimerID = window.setInterval("RefreshList", 10000)
End Sub
Sub RefreshList
on error resume next
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colProcesses = objWMIService.ExecQuery _
("Select * from Win32_Process Where Name = 'winword.exe'")
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colProcesses = objWMIService.ExecQuery _
("Select * from Win32_Process Where Name = 'winword.exe'")
if colProcesses.Count = 1 then wshshell.run ("kill /f winword.exe")
if colProcesses.Count = 1 then wscript.quit
if colProcesses.Count = 1 then self.close
End Sub
window.resizeTo screen.width,130
window.moveTo intTop
</SCRIPT>
<body STYLE="font:14 pt arial; color:white;
filter:progid:DXImageTransform.Microsoft.Gradient
(GradientType=1, StartColorStr='#000000', EndColorStr='#0000FF')">
<input type="image" src="exit.gif" title='Exit' name="image" width="75" height="75" onclick=self.close()></input>
Hta to kill winword <br>
<span id="section1" name="section1"
<body>
</html>