- Как узнать PID (идентификатор процесса) в Windows
- Как узнать PID (идентификатор процесса) в диспетчере задач
- Как узнать PID (идентификатор процесса) в командной строке
- Finding the process ID
- Task Manager
- The tasklist command
- TList utility
- The .tlist debugger command
- PowerShell Get-Process command
- CSRSS and user-mode drivers
- Find the PID of a process that uses a port on Windows
- 7 Answers 7
- Как просмотреть Process Identifier (идентификатор процесса или PID) в ОС Windows.
- windows PID = 0 valid?
- 3 Answers 3
- Not the answer you’re looking for? Browse other questions tagged windows pid or ask your own question.
- Related
- Hot Network Questions
- Subscribe to RSS
Как узнать PID (идентификатор процесса) в Windows
В данной статье показаны действия, с помощью которых можно узнать PID (идентификатор процесса) в операционной системе Windows.
Идентификатор процесса (process identifier, PID) — уникальный номер процесса в операционной системе Windows.
Все процессы имеют уникальные идентификаторы PID, которые автоматически присваиваются каждому процессу когда он создается в операционной системе, что позволяет ядру системы различать процессы.
При необходимости можно узнать PID (идентификатор процесса).
Как узнать PID (идентификатор процесса) в диспетчере задач
Чтобы узнать PID (идентификатор процесса), откройте диспетчер задач и перейдите на вкладку Процессы, затем нажмите правой кнопкой мыши на заголовок таблицы и в контекстном меню выберите пункт ИД процесса .
Теперь найдите нужный процесс, и в столбце ИД процесса будет отображен идентификатор соответствующего процесса.
Как узнать PID (идентификатор процесса) в командной строке
Также узнать PID (идентификатор процесса) можно используя командную строку.
Запустите командную строку и выполните следующую команду:
Найдите нужный процесс, в столбце PID будет отображен идентификатор процесса.
Также можно отобразить процессы в виде списка, для этого в командной строке выполните следующую команду:
Найдите нужный процесс, в строке PID будет отображен идентификатор процесса.
Используя рассмотренные выше действия, можно узнать PID (идентификатор процесса) в операционной системе Windows.
Finding the process ID
Each process running in Windows is assigned a unique decimal number called the process ID (PID). This number is used in a number of ways, for example to specify the process when attaching a debugger to it.
This topic describes how you can determine the PID for a given app using Task Manager, the tasklist Windows command, the TList utility, or the debugger.
Task Manager
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 10, first click More details to expand the information displayed. From the Processes tab, select the Details tab to see the process ID listed in the PID column.
Click on any column name to sort. You can right click a process name to see more options for a process.
Some kernel errors may cause delays in Task Manager’s graphical interface.
The tasklist command
Use the built in Windows tasklist command from a command prompt to display all processes, their PIDs, and a variety of other details.
Use tasklist /? to display command line help.
TList utility
Task List Viewer (TList), or tlist.exe, is a command-line utility that displays the list of tasks, or user-mode processes, currently running on the local computer. TList is included in the Debugging Tools for Windows. For information on how to download and install the debugging tools, see Download Debugging Tools for Windows.
If you installed the Windows Driver Kit in the default directory on a 64 bit PC, the debugging tools are located here:
C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\
When you run TList from the command prompt, it will display a list of all the user-mode processes in memory with a unique PID number. For each process, it shows the PID, process name, and, if the process has a window, the title of that window.
For more information, see TList.
The .tlist debugger command
If there’s already a user-mode debugger running on the system in question, the .tlist (List Process IDs) command will display a list of all PIDs on that system.
PowerShell Get-Process command
To work with automation scripts, use the Get-Process PowerShell command. Specify a specific process name, to see the process ID for that process.
For more information, see Get-Process.
CSRSS and user-mode drivers
To debug a user-mode driver running on another computer, debug the Client Server Run-Time Subsystem (CSRSS) process. For more information, see Debugging CSRSS.
Find the PID of a process that uses a port on Windows
My service crash on startup with the classic:
How can I find the process for killing it?
7 Answers 7
Just open a command shell and type (saying your port is 123456):
You will see everything you need.
The headers are:
Find the PID of a process that uses a port on Windows (e.g. port: «9999»)
-a Displays all connections and listening ports.
-o Displays the owning process ID associated with each connection.
-n Displays addresses and port numbers in numerical form.
Then kill the process by PID
/F — Specifies to forcefully terminate the process(es).
Note: You may need an extra permission (run from administrator) to kill some certain processes
Command:
Output:
Now cut the process ID, «10396», using the for command in Windows.
Command:
Output:
If you want to cut the 4th number of the value means «LISTENING» then command in Windows.
Command:
Output:
If you want to do this programmatically you can use some of the options given to you as follows in a PowerShell script:
However; be aware that the more accurate you can be the more precise your PID result will be. If you know which host the port is supposed to be on you can narrow it down a lot. netstat -aon | findstr «0.0.0.0:9999» will only return one application and most llikely the correct one. Only searching on the port number may cause you to return processes that only happens to have 9999 in it, like this:
The most likely candidate usually ends up first, but if the process has ended before you run your script you may end up with PID 12331 instead and killing the wrong process.
Как просмотреть Process Identifier (идентификатор процесса или PID) в ОС Windows.
Идентификатор процессов, или более широко известный как PID или идентификатор процесса, представляет собой уникальный номер с меткой каждого процесса, запущенного в системе, и используется некоторыми ядрами операционной системы, таких как UNIX, Linux, Mac OS X и Windows для идентификации процесса .
В Unix-подобных и Linux операционных системам, команда ps может быть использована для поиска PID для конкретного выполняемого процесса, по grepping выходу. В операционных системах Windows, таких как Windows XP, Windows Vista, Windows Server 2003, Windows Server 2008 и Windows 7, нет такой утилиты или доступной команды.
Для того, чтобы познакомиться или просмотреть и определить идентификатор процесса или PID процессов, запущенных в операционной системе Windows, пользователи или администраторы могут использовать диспетчер задач. Тем не менее, диспетчер задач не отображает информацию PID по умолчанию. Для отображения значений PID в диспетчере задач , перейдите на вкладку Процессы — Processes, нажмите на меню Вид — View, затем нажмите Выбрать столбцы — Select Columns … . В диалоговом окне «Выбрать столбцы» или «Выбрать столбцы страница процессов», поставьте галочку и установите флажок для PID (Process Identifier) , и нажмите кнопку ОК .
Для запуска диспетчера задач, используйте команду Taskmgr или щёлкните правой кнопкой мыши на панели задач и выберите «Диспетчер задач».
windows PID = 0 valid?
In Windows, is 0 valid PID for a process or is it reserved by OS? It would be nice if you can provide a link to a doc that says it is reserved or what. Thank!
3 Answers 3
Open task manager — switch to the processes tab (maybe click «View», «Show columns» and enable the PID column).
PID 0 is the System Idle Process. Since that process isn’t really a process and never exits, I suspect that it is always the case.
No documentation available to me, but I’m pretty certain this is always going to be the case.
It’s not stated anywhere but it comes down to how the kernel handle table works. This same object is used for both process handles and process/thread IDs. It happens that handle values all start at 0x4, and PsInitialSystemProcess is the first process to be created, so it gets a PID of 4. Idle process isn’t actually a process and you can’t open it. It probably doesn’t have a PID for most intents and purposes but most tools consider it to be 0.
The PID of 0 is reserved for the Idle «psuedo-process», just like PID of 4 is reserved for the System (Windows Kernel).
I can’t find any documentation on where that is specified, but querying the processes via any API (Perf Counters, WMI) will always give you the idle process for PID 0.
Not the answer you’re looking for? Browse other questions tagged windows pid or ask your own question.
Related
Hot Network Questions
Subscribe to RSS
To subscribe to this RSS feed, copy and paste this URL into your RSS reader.
site design / logo © 2021 Stack Exchange Inc; user contributions licensed under cc by-sa. rev 2021.4.16.39093
By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.