Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Killing the windows process using QTP Script.
#5
Solved: 11 Years, 3 Months, 2 Weeks ago
Hi,

You can use the below function. This will kill any process runing in task manager. All u need to do is to pass the Program name.
Code:
Public Function General_CloseProcess(strProgramName)
   Dim objshell
   Set objshell=CreateObject("WScript.Shell")
   objshell.Run "TASKKILL /F /IM "& strProgramName
   Set objshell=nothing
End Function

'If want to close excel
Call General_CloseProcess("Excel.EXE")
'Killing word
Call General_CloseProcess("WINWORD.exe")

Regards,
Ankesh
Reply


Messages In This Thread
RE: Killing the windows process using QTP Script. - by Ankesh - 05-03-2012, 01:13 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Control to spawned process DomG 1 1,153 07-03-2020, 07:21 PM
Last Post: Ankur
  Windows 8 envirnment error while running QTP script. Rashmi Rajpal 0 2,433 10-10-2013, 12:21 PM
Last Post: Rashmi Rajpal
  Running QTP script via Cron/Windows Scheduler/ ksnalni 3 5,220 05-08-2012, 10:19 AM
Last Post: sshukla12
  QTP Business Process Testing vijaya2009 1 4,849 01-11-2012, 11:38 AM
Last Post: nileshpatil70
Smile Need Some Info - on Automation process Nageshearaiah 0 2,256 06-11-2011, 06:10 PM
Last Post: Nageshearaiah

Forum Jump:


Users browsing this thread: 3 Guest(s)