Below function will close running process from task manager.
Function CloseProcess(strProgramName)
Dim objShell
Set objShell = CreateObject("WScript.Shell")
objShell.Run "TASKKILL /F /IM " & strProgramName
Set objShell = Nothing
End Function
Dim objShell
Set objShell = CreateObject("WScript.Shell")
objShell.Run "TASKKILL /F /IM " & strProgramName
Set objShell = Nothing
End Function
Taskkill is a commancd which ends one or more tasks or processes. Processes can be killed by process ID or image name.
"TASKKILL /F /IM " & strProgramName
/F :: Forcefully closing the application
/IM :: Image Name. Nothing but the visible exe file in task manager. Since we dont know the process id, i hv used Image name to kill the process. strProgramName contains the .exe file name which has to be killed.
To close browser say IE, just call the function as
Call CloseProcess("iexplorer.exe")'Closes IE
Call CloseProcess("Excel.exe") ''Closes excel.
ReplyDeleteNice information about the load testing!!! I prefer Loadrunner automation testing tool to validate the performance of software application/system under actual load.
Regards:
Loadrunner classes in Chennai |
Best qtp training institute in Chennai