0

SO is Windows 11. When I open a cmd window and then run the title command, I can see the window title changing in the window tab. But then when I run tasklist, I get N/A in window title property.

Here is the sequence of commands:

cmd.exe
title aaa
tasklist /v /fi "imagename eq cmd.exe" /fo list

cmd is run from the Windows search bar (does not matter really, I think).

result:

Image Name:   cmd.exe
PID:          24088
Session Name: Console
Session#:     1
Mem Usage:    6,244 K
Status:       Unknown
User Name:    AzureAD\XXXXXXXX
CPU Time:     0:00:00
Window Title: N/A

Below a picture. enter image description here

Does anyone knows why this is happening?.

I have tracked down this as a potential reason for a batch file failure using the TASKKILL command: TASKKILL /F /FI "WINDOWTITLE eq aaa" /IM cmd.exe

Javgs
  • 43
  • 6
  • Screenshot looks like a Terminal process (aka OpenConsole.exe) not a window attached to cmd.exe. – josh poley Jul 26 '23 at 13:59
  • I don't understand. It is run by typing cmd.exe in the windows search bar. It also does say that in the Image Name property. – Javgs Jul 26 '23 at 14:09
  • Title's just a name for a window tab. It's not a program or process name. The system probably doesn't store it as a task name. – Br.Bill Jul 26 '23 at 23:59
  • WINDOWTITLE is commonly used to filter for a taskkill command. Many examples can be found here in stackoverflow. Only one example: https://stackoverflow.com/questions/10948235/taskkill-window-spaces-in-its-title-name/25771089#25771089 – Javgs Jul 27 '23 at 11:11
  • Actually I just verified that the command TASKKILL /F /FI "WINDOWTITLE eq aaa" /T quoted in the question, does work. I don't know why including a flag to kill child processes (/T) might make the windows title filter work. The idea comes from what is suggested in this answer https://stackoverflow.com/a/51503315/11233327 – Javgs Jul 27 '23 at 11:20

0 Answers0