Windows посмотреть процессы с командной строки

The tasklist is the Windows command we use to list running processes on a Windows system. Often operates together with taskkill to terminate a running process or processes.

Open a command prompt (CMD or PowerShell), type tasklist, and press Enter:

tasklist

The following screenshot shows the default output of the tasklist command. It shows the Image Name (the name of the program that launched the process), process ID (PID), and the Memory Usage of each task.

Windows tasklist command

The list can be long, so you may want to pipe the output to the more command (press Enter key to scroll through).

tasklist | more

If you want to end a process, use the taskkill command to terminate a running process using its process ID (PID) or image name.

taskkill /pid process-ID
taskkill /im image-name

For example, the following command terminates all instances of the notepad process by its image name.

taskkill /im notepad.exe

The Windows tasklist command supports three output formats: Table (the default), List, and CSV. To change the output format, use the /fo option, as shown in the following example:

tasklist /fo list

The following command saves the current task list into a text file in CSV format:

tasklist /fo csv > tasklist.txt

Running Tasklist Command on a Remote Computer

We can use the tasklist command to list running tasks on a remote computer. Use the /s and /u options to specify the IP Address and username of the remote computer, respectively.

tasklist /s 192.168.1.100 /u user1

However, the Firewall must be configured on the remote Windows system to allow the tasklist command. Click the link below for instructions on how to do it.

How to allow tasklist command from Windows Firewall

Command Options

The tasklist command has multiple options, which you can see by typing tasklist /?.

tasklist command options

Examples

Use the /V option to display additional information, such as the program’s username and total CPU time:

tasklist /v

Show the list of dll files used by each process:

tasklist /m

Display the services provided by each process:

tasklist /svc

Using Filters to List Tasks That Match a Given Criteria

Using the /fi option, you can filter the command output to display the tasks that match the given criteria. The following section presents some examples.

Using Filters to List Tasks That Match a Given Criteria

List running processes:

tasklist /fi "status eq running"

List tasks that not responding:

tasklist /fi "status eq not responding"

List the process that has PID of 0:

tasklist /fi "pid eq 0"

List all processes owned by the user user1:

tasklist /fi "username eq user1"

Display the services are related the svchost process(es):

tasklist /svc /fi "imagename eq svchost.exe"

Show the processes using more than 10MB of memory:

tasklist /fi "memusage gt 10240"

You can get a list of all filters by running the tasklist /? command.

In Windows, we can get the list of processes running on the system from command prompt also. We can use ‘tasklist‘ command for this purpose.
Using this command we can selectively list the processes based on criteria like the memory space used, running time, image file name, services running in the process etc. Below you can find the syntax and examples for various cases.

Get the list of all the process running on the system

tasklist

Get the list of process using memory space greater than certain value.

tasklist /fi "memusage gt memorysize"

Memory size should be specified in KB
For example, to get the list of processes occupying more than 30MB of memory, we can run the below command.

tasklist /fi "memusage gt 30000"

Find the list of processes launched by a user

tasklist /fi "username eq userName"

Find the memory usage of a specific process

tasklist /fi "pid eq processId"

Example:

c:\>tasklist /fi "pid eq 6544"
Image Name                     PID Session Name        Session#    Mem Usage
========================= ======== ================ =========== ============
WmiPrvSE.exe                  6544 Services                   0      8,936 K

Find the list of not responding processes

tasklist /fi "status eq not responding"

example:

c:\>tasklist /fi "status eq not responding"
Image Name                     PID Session Name        Session#    Mem Usage
========================= ======== ================ =========== ============
rundll32.exe                  3916 Console                    1      7,028 K

Get the list of services running in a process

tasklist /svc /fi "pid eq processId"

Example:

c:\>tasklist /svc /fi "pid eq 624"
Image Name                     PID Services
========================= ======== ============================================
lsass.exe                      624 EFS, KeyIso, Netlogon, ProtectedStorage,
                                   SamSs, VaultSvc
c:\>

Get list of processes running for more than certain time

tasklist /fi "cputime gt hh:mm:ss"

example:
Get the list of processes that have been running from more than an hour and 20 minutes.

c:\>tasklist /fi "cputime gt 01:20:00"
Image Name                     PID Session Name        Session#    Mem Usage
========================= ======== ================ =========== ============
System Idle Process              0 Services                   0         24 K
SynTPEnh.exe                  4152 Console                    1      8,080 K
firefox.exe                   1740 Console                    1    857,536 K
c:\>

Find processes that are running a specified image file:

tasklist /fi "imagename eq imageName"

Example:

c:\>tasklist /fi "imagename eq firefox.exe"
Image Name                     PID Session Name        Session#    Mem Usage
========================= ======== ================ =========== ============
firefox.exe                   1740 Console                    1    812,160 K
c:\>

Find the process running a specific service

tasklist /fi "services eq serviceName"

example:

c:\>tasklist /fi "services eq webclient"

Image Name                     PID Session Name        Session#    Mem Usage
========================= ======== ================ =========== ============
svchost.exe                   1052 Services                   0     20,204 K
c:\>

Related Posts:
How to kill a process from windows command line.

Все способы:

  • Способ 1: «Диспетчер задач»
  • Способ 2: «PowerShell»
  • Способ 3: «Командная строка»
  • Способ 4: Сторонние приложения
  • Вопросы и ответы: 0

Способ 1: «Диспетчер задач»

Для просмотра процессов и управления ими в Windows 10 предусмотрено штатное приложение «Диспетчер задач». Его использование является самым простым, удобным и наглядным способом получения сведений о запущенных в системе системных и сторонних процессов.

  1. Откройте «Диспетчер задач» из контекстного меню «Панели задач» или любым другим удобным вам способом.

    Подробнее: Способы открыть «Диспетчер задач» в Windows 10

  2. Как получить список всех процессов в Windows 10-1

  3. Список процессов, а если точнее, их названий, доступен для просмотра в одноименной вкладке: в ней будет указан уровень загрузки ЦП, ОЗУ, диска и сети для каждого процесса.
  4. Как получить список всех процессов в Windows 10-2

  5. Если слева от имени процесса располагается импровизированная стрелка, значит, процесс содержит один и более подпроцессов. Кликните по стрелке, чтобы просмотреть подпроцессы.
  6. Как получить список всех процессов в Windows 10-3

Просмотреть процессы в «Диспетчере задач» можно также на вкладке «Подробности». Здесь, помимо исполняемого файла процесса, для просмотра доступны такие данные, как его идентификатор, состояние, владелец, используемый объем памяти и название.

Как получить список всех процессов в Windows 10-4

Способ 2: «PowerShell»

Вывести список запущенных процессов можно также с помощью консоли «PowerShell». Способ хорош тем, что позволяет получать дополнительные данные о процессах и гибко сортировать их при необходимости.

  1. Откройте консоль «PowerShell» от имени администратора из контекстного меню кнопки «Пуск».
  2. Как получить список всех процессов в Windows 10-5

  3. Введите в консоли команду Get-Process и нажмите клавишу ввода.
  4. Как получить список всех процессов в Windows 10-6

В результате вы получите список процессов с указанием таких свойств, как количество дескрипторов ввода («Handles»), выгружаемый и невыгружаемый размер данных процесса «(PM(K) и NPM(K))», объем используемой процессом памяти («WS(K)»), процессорное время («CPU(s)») и идентификатор («ID»). Имя процесса будет указано в столбце «ProcessName».

Способ 3: «Командная строка»

Для получения списка процессов сгодится и классическая «Командная строка», однако в этом случае вы получите несколько меньший объем свойств процессов.

  1. Откройте «Командную строку» от имени администратора через поиск или другим известным вам методом.

    Подробнее: Открытие «Командной строки» в Windows 10

  2. Как получить список всех процессов в Windows 10-7

  3. Выполните команду tasklist.
  4. Как получить список всех процессов в Windows 10-8

В результате, помимо названий процессов, вы получите следующие сведения: идентификаторы, имя сессии, номер сеанса и объем ОЗУ, потребляемый каждым процессом.

Способ 4: Сторонние приложения

Если вы хотите получить о запущенных процессах максимум деталей, лучше использовать специализированные сторонние программы, например Process Explorer — мощный бесплатный инструмент управления процессами.

Скачать Process Explorer с официального сайта

  1. Скачайте исполняемый файл утилиты procexp.exe или procexp64.exe и запустите.
  2. Если до этого программа никогда не запускалась, вам будет предложено принять лицензионное соглашение.
  3. Как получить список всех процессов в Windows 10-9

  4. В результате в левой колонке приложения будет выведен список всех запущенных на компьютере процессов. Если нужно просмотреть свойства процесса, кликните по нему два раза мышкой.
  5. Как получить список всех процессов в Windows 10-10

Одним лишь просмотром процессов и их свойств возможности Process Explorer не ограничиваются. С помощью этой небольшой портативной программы вы можете принудительно завершать работу процессов, изменять их приоритет, создавать дампы памяти, выявлять связанные динамические библиотеки, а также выполнять другие операции.

Наша группа в TelegramПолезные советы и помощь

Способов управлять процессами в Windows предостаточно, и командная строка занимает в них далеко не первое место. Однако иногда бывают ситуации, когда все остальные инструменты кроме командной строки недоступны, например некоторые вредоносные программы могут блокировать запуск Task Manager и подобных ему программ. Да и просто для общего развития полезно знать способы управления компьютером из командной строки.

Для управления процессами в командной строке есть две утилиты — tasklist и taskkill. Первая показывает список процессов на локальном или удаленном компьютере, вторая позволяет их завершить. Попробуем …

Если просто набрать команду tasklist в командной строке, то она выдаст список процессов на локальном компьютере.

команда tasklist

По умолчанию информация выводится в виде таблицы, однако ключ /fo позволяет задать вывод в виде списка или в формате CSV, а ключ /v  показывает более подробную информацию о процессах, например команда tasklist /v /fo list выведет подробное описание всех процессов в виде списка.

команда tasklist

Список получится довольно большой, поэтому попробуем уточнить запрос.  Для этого используем ключ /fi , который позволяет использовать фильтры для вывода данных, например команда tasklist /fi ″username eq user″ /fi ″memusage le 40000″ выводит список процессов пользователя user, которые потребляют не больше 40Мб памяти.

команда tasklist

Найдя процессы, которые необходимо завершить, воспользуемся командой taskkill. Завершать процессы можно по имени, идентификатору процесса (PID) или задав условия с помощью фильтров. Для примера запустим несколько экземпляров блокнота (notepad.exe) и попробуем завершить его разными способами.

команда taskkill

Ключ /f завершает процесс принудительно, а /t завершает все дочерние процессы.

Полную справку по командам tasklist и taskkill можно получить, введя их с ключом /?

Теперь пустим в ход тяжелую артиллериюPowerShell. Его можно запустить не выходя из командной строки. Для получения списка процессов используем командлет Get-Process.

командлет Get-Process

Чтобы не выводить весь список процессов можем воспользоваться командлетом Where-Object, который задает фильтр для выводимой информации. Для примера выведем список процессов, которые загружают процессор и отсортируем их по возрастанию нагрузки с помощью команды:

Get-Process | where {$_.cpu -gt 0} | sort cpu

фильтруем вывод процессов

С помощью PowerShell мы можем получить любую информацию о любом процессе. В качестве примера возьмем процесс cmd и выведем список его свойств командой:

Get-Process -Name cmd | Get-Member -Membertype property

смотрим свойства процесса cmd

Выбираем те свойства, что нам интересны ( в примере имя и ID процесса, путь к файлу, используемые модули и время запуска) и выводим их в виде списка командой:

Get-Process -Name cmd | Format-List name, id, path, modules, starttime

выводим свойства процесса

Таким образом мы можем посмотреть когда и кем был запущен процесс, сколько он потребляет ресурсов, где находится исполняемый файл и еще много различной информации.

Для завершения процесса в PowerShell есть командлет Stop-Process. Он завершает указанный процесс по его имени или идентификатору. Однако мы поступим по другому и передадим результат выполнения командлета Get-Process по конвейеру:

Get-Process | where {$_.name -match ″notepad″}  | Stop-Process

завершаем процесс

Get-Process не может показать процессы на удаленном компьютере, для этого воспользуемся командлетом Get-WmiObject , например посмотрим процессы на удаленном компьютере PC командой:

Get-WmiObject win32_process -computername PC | ft name, processid, description

смотрим процессы на удаленном компьютере

Для боле полного ознакомления с PowerShell можно воспользоваться встроенной справкой, для вызова справки нужно набрать Get-Help ″имя командлета″

Ну и для полноты обзора рассмотрим еще одно средство для управления процессами из командной строки. Это утилиты Pslist и Pskill входящие в состав пакета PSTools от компании Sysinternals.

Эти утилиты не требуют специальной установки, достаточно просто скопировать их на диск. Для запуска нужно зайти в папку с утилитами и ввести в командной строке необходимую команду.

команда pslist

Pslist может выводить информацию о процессах по имени или ID, например командой pslist notepad -x выведем подробную информацию о нашем «многострадальном» блокноте.

подробный вывод информации о процессе

Особенностью утилиты Pslist является режим task-manager. В  этом режиме информация автоматически обновляется, причем можно задать время работы и интервал обновления. Запускается режим ключом -s , например командой tasklist -s -r 10 запускаем режим программу в режиме task-manager с обновлением раз в 10 сек.

task-manager mode

Завершение процесса программой pskill предельно просто, вводим команду и имя (или ID) процесса и все.

завершение процесса

Справку по утилитам Pslist и Pskill можно посмотреть, введя команду с ключом /?

И еще, все манипуляции с процессами необходимо выполнять с правами администратора, для этого командную строку требуется запускать с повышением привилегий.

You can easily view information about your computer using Windows graphical tools like Task Manager or System Information. However, some users prefer terminal environments like the Command Prompt or PowerShell for almost everything. If you’re curious about how to get system info in CMD (Command Prompt) or want to learn how to view and manage running processes from Windows’ CMD, keep reading. I’ll show you how to do all of these things:

NOTE: The information in this tutorial applies to Windows 10 and Windows 11, and the commands work both in Command Prompt and PowerShell.

1. How to get system information in CMD with the Systeminfo command

Windows has a built-in command to check the system configuration called systeminfo. Running this command displays a long list of information about your computer. Open Command Prompt or PowerShell, and run the command as-is:

systeminfo

Systeminfo is the command that lets you check PC specs

Systeminfo is the command that lets you check PC specs

Do you see what’s happening? The systeminfo command reveals details about your operating system, computer hardware, and software components. You’ll see details such as the version of the operating system version on your computer, RAM status, and processor model, as well as network information like the IP and MAC addresses.

TIP: If you’d like to find out even more information about the systeminfo command, Microsoft offers excellent documentation for it: Microsoft Learn Systeminfo.

2. How to see the list of running processes using the Tasklist command

To view the list of currently running processes in Command Prompt or PowerShell, run the command:

tasklist

Tasklist lets you view running processes in Windows' CMD

Tasklist lets you view running processes in Windows’ CMD

The command lists the processes running on your computer. In addition to their names, the list includes details like the processes’ PIDs (Process identifiers) and the memory they use.

TIP: For more information on how the tasklist command works and what parameters it accepts, check the Microsoft Learn Tasklist documentation.

3. How to stop a process using the Taskkill command

To kill or stop a running process from Command Prompt or PowerShell, use the taskkill command. For example, to stop OneDrive, whose process is called OneDrive.exe, run the command:

taskkill /f /im OneDrive.exe

The /f parameter forcefully terminates the process, and the /im parameter identifies and stops a process by its name.

How to stop a process from CMD

How to stop a process from CMD

There are times when you need to open a program multiple times. Every new window and sometimes the tabs of a specific program (for example, Microsoft Edge) creates a separate process called instance with a unique PID (Process identifier).

To stop a single instance, specify its PID (Process identifier). For example, there are a couple of instances of Microsoft Edge open on my computer. The process’s name is msedge.exe, but I only want to close one of its running instances (tabs, windows).

Multiple instances of a process have unique process identifiers

Multiple instances of a process have unique process identifiers

If I want to kill the process with the 12820 PID, I must run the command:

taskkill /PID 12820

Killing a process in CMD using its PID

Killing a process in CMD using its PID

Another useful parameter for the taskkill command is /t, which terminates a specified process and any child processes it started.

Take the same example: the Microsoft Edge process. To kill all instances of Microsoft Edge, run the command:

taskkill /t /im msedge.exe

Kill all the instances of an app from CMD

Kill all the instances of an app from CMD

TIP: If you’d like to discover all the ins and outs of the taskkill command, including advanced uses for it, read its documentation: Microsoft Learn Taskkill.

Warning! Misusing these kill commands can result in data loss in running processes. Always proceed carefully and make sure you’ve backed up your data.

Do you use CMD to get system info and manage running processes?

You know now how to use commands to view system information and manage processes. Do you like having this level of control over your computer? Comment below and share your experiences with CMD and PowerShell. Also, if you have any favorite commands, don’t hesitate to share them with some background information on how you’re using them. They’ll surely be helpful to other people reading this article.

Понравилась статья? Поделить с друзьями:
0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии
  • Foxconn n15235 драйвера для windows 7 официальный сайт
  • Как сделать чтобы ноутбук не выключался через определенное время windows 10
  • Manhunt патч для windows 10
  • Windows server version history
  • Как подключить блютуз колонку к ноутбуку через блютуз windows 10