12-04-2012, 10:09 AM
I tried to fetch all the processess in a system using WMI and QTP is not recognising the object.Can anyone help me in getting the code to fetch the list of all the processes running in a system?
|
How to create a script in QTP to get all the processes in a system
|
|
12-04-2012, 10:09 AM
I tried to fetch all the processess in a system using WMI and QTP is not recognising the object.Can anyone help me in getting the code to fetch the list of all the processes running in a system?
12-06-2012, 04:34 PM
Below is code,
if you use "." for strComputer, it will fetch the details of the local machine. If you want to fetch the list of process running in a remote machine, use the machine id in place of ".". E.g.: Code: strComputer = "REMOTE-MACHINE100"
--
Dim Process, strComputer
Process = ""
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\cimv2")
Set colProcess = objWMIService.ExecQuery _
("Select * from Win32_Process")
count = 0
For Each objProcess in colProcess
Process = Process + vbnewline + objProcess.Name
count = count + 1
Next
Print Process
Set objWMIService = Nothing
Set colProcess = NothingHope this helps... Thanks, Elango
12-20-2012, 10:04 AM
HI for getting process of remotr machine its not fetching process... In case if its not fetching becuase of authentication issue.. let me know the code pls...
12-21-2012, 09:41 AM
Thanks for the reply
12-24-2012, 01:45 PM
If you are in a network, you should have access to the machine from which you are trying to fetch the processes. It wont work otherwise.
Thanks, Elango
01-08-2013, 05:25 PM
Thank U
![]()
|
|
« Next Oldest | Next Newest »
|
| Possibly Related Threads… | |||||
| Thread | Author | Replies | Views | Last Post | |
| How to make QTP Script to work when system gets locked? | ramkumarad | 6 | 13,888 |
11-02-2017, 03:37 PM Last Post: Divv |
|
| Create a wrap for the main script ? | Linuxuser | 0 | 2,026 |
02-07-2017, 12:08 AM Last Post: Linuxuser |
|
| cannot create java virtual machine on QTP 12.02 version | richa5685 | 0 | 2,370 |
02-23-2016, 11:18 AM Last Post: richa5685 |
|
| Local System Monitor | kbhargava505 | 0 | 2,818 |
10-16-2015, 12:52 PM Last Post: kbhargava505 |
|
| QTP system related issue | Bharathi Kanagarajan | 1 | 2,493 |
09-12-2015, 11:28 PM Last Post: ADITI1992 |
|