QTP Forum


Join the forum, it's quick and easy

QTP Forum
QTP Forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Search
 
 

Display results as :
 


Rechercher Advanced Search

Poll
Keywords

Latest topics
» composite primary key
How to kill Application process or multiple processes using VBscript EmptyThu Jun 19, 2014 11:31 am by thomasdfg

» How to identify the object when it is dynamically changing behavior
How to kill Application process or multiple processes using VBscript EmptyWed Jun 18, 2014 6:37 pm by thomasdfg

» Patches for QTP 10, 11, 11.5
How to kill Application process or multiple processes using VBscript EmptyWed Jun 18, 2014 6:04 pm by thomasdfg

» Retrieving data from Txt file into datatable
How to kill Application process or multiple processes using VBscript EmptyWed Jun 18, 2014 5:32 pm by thomasdfg

» VB Script to count number of links in a web page.
How to kill Application process or multiple processes using VBscript EmptyWed Jun 18, 2014 4:51 pm by thomasdfg

» Customized HTML reports in QTP
How to kill Application process or multiple processes using VBscript EmptyWed Jun 18, 2014 4:42 pm by thomasdfg

» how to print values into a field of a web page, from a data table in qtp?
How to kill Application process or multiple processes using VBscript EmptyWed Jun 18, 2014 4:37 pm by thomasdfg

» How to delete cookies using QTP?
How to kill Application process or multiple processes using VBscript EmptyWed Jun 18, 2014 4:30 pm by thomasdfg

» When UFT Does Not Identify an Object
How to kill Application process or multiple processes using VBscript EmptyWed Jun 18, 2014 4:23 pm by thomasdfg

April 2024
MonTueWedThuFriSatSun
1234567
891011121314
15161718192021
22232425262728
2930     

Calendar Calendar

Affiliates
free forum

Similar topics

    How to kill Application process or multiple processes using VBscript

    Go down

    Vote if this topic was useful to you

    How to kill Application process or multiple processes using VBscript Vote_lcap0%How to kill Application process or multiple processes using VBscript Vote_rcap 0% 
    [ 0 ]
    How to kill Application process or multiple processes using VBscript Vote_lcap0%How to kill Application process or multiple processes using VBscript Vote_rcap 0% 
    [ 0 ]
    How to kill Application process or multiple processes using VBscript Vote_lcap100%How to kill Application process or multiple processes using VBscript Vote_rcap 100% 
    [ 1 ]
    How to kill Application process or multiple processes using VBscript Vote_lcap0%How to kill Application process or multiple processes using VBscript Vote_rcap 0% 
    [ 0 ]
     
    Total Votes : 1
     
     

    How to kill Application process or multiple processes using VBscript Empty How to kill Application process or multiple processes using VBscript

    Post by Gajre Wed Jul 04, 2012 3:42 am

    ''The below code can be used to kill a process/ processes, running in the Windows Task Manager.

    strProcessNames = "EXCEL.exe|chrome.exe|notepad.exe"
    Call KillProcesses(strProcessNames)

    Function KillProcesses(strProcessNames)
    ''Get Current User Logged In
    Set objNetwork1 = CreateObject("Wscript.Network")
    currUser1 = objNetwork1.UserName
    ''Kill Process(es) based on *.exe and current user
    strComputer = "."
    Set objWMIService1 = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\" & strComputer & "\root\cimv2")
    ''Split the Processes by the delimiter and loop them
    KillProcess1 = Split(strProcessNames,"|")
    For x = 0 to Ubound(KillProcess1)
    Set colProcessList1 = objWMIService1.ExecQuery _
    ("SELECT * FROM Win32_Process WHERE Name ='"& KillProcess1(x) &"'")
    For Each objProcess1 in colProcessList1
    If objProcess1.GetOwner ( User, Domain ) = 0 Then
    If UCase(User) = UCase(currUser1) then
    objProcess1.Terminate()
    end if
    end if
    Next
    Next
    End Function
    Gajre
    Gajre
    Admin

    Posts : 37
    Join date : 2012-06-17
    Age : 41
    Location : Hyderabad

    https://qtpelearning.forumotion.com

    Back to top Go down

    Back to top

    - Similar topics

     
    Permissions in this forum:
    You cannot reply to topics in this forum