Wednesday, July 16, 2014

PowerShell Script to find Process IDs of an Executable

To find the priority of Threads of a process, copy the following script and execute in PowerShell

$timeoutInSeconds = 100;
$processName = "myExecutable.exe"

$processList = Get-WmiObject win32_process | where { $_.ProcessName -eq "$processName" } | select Handle
foreach ($processIds in $processList)
{
    $processId = $processIds.Handle
    Write-Host "process id = $processId"
}


Disclaimer: Use at your own risk. The author does not take any responsibility for the behavior of this script.

No comments:

Post a Comment