Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get process ID from Com Object

It is possible to get the Process ID from this new Com Object ($ie) ?

$ie=New-Object -comobject InternetExplorer.Application  
$ie.visible=$true  
$ie.Navigate("www.stackoverflow.com")
like image 524
LaPhi Avatar asked Nov 29 '10 14:11

LaPhi


People also ask

How can I Get-Process ID?

Task Manager can be opened in a number of ways, but the simplest is to select Ctrl+Alt+Delete, and then select Task Manager. In Windows, first click More details to expand the information displayed. From the Processes tab, select Details to see the process ID listed in the PID column. Click on any column name to sort.

How do I find the process ID in PowerShell?

To find the PID of a process, type Get-Process . Indicates that the UserName value of the Process object is returned with results of the command. Specifies one or more process objects. Enter a variable that contains the objects, or type a command or expression that gets the objects.

How do I find service process ID?

How to get PID using Task Manager. Press Ctrl+Shift+Esc on the keyboard. Go to the Processes tab. Right-click the header of the table and select PID in the context menu.

How do I find the PID of a process in Linux?

The easiest way to find out if process is running is run ps aux command and grep process name. If you got output along with process name/pid, your process is running.


1 Answers

The following will give you the parent IE process:

(Get-Process -Name iexplore)| Where-Object {$_.MainWindowHandle -eq $ie.HWND}
like image 160
Dirk Vollmar Avatar answered Oct 06 '22 04:10

Dirk Vollmar