We need to get the last active window's title of a process.
Currently We are using the command tasklist /v
and parsing it to get the window title.
Problem:
We are not able to get the last active window's title if we run the command under system account in services
.
Output If we run under windows account/system account (not from services):
Image Name
PID
Session Name
Session#
Mem Usage
Status
User Name
CPU Time
Window Title
firefox.exe
4476
Console
1
509,224 K
Running
Ramesh
0:01:47
Getting the window title of a process
Output If we run under windows account/system account (from services):
Image Name
PID
Session Name
Session#
Mem Usage
Status
User Name
CPU Time
Window Title
firefox.exe
4476
Console
1
509,224 K
Running
Ramesh
0:01:47
N/A
Our application is running under system account from services. Is there a way to get the windows title from a program running under system account from services?