How to get the window title text from batch file
In cmd.exe (usual command line prompt):
Set window's title:
title "Your New Title"
Get window's title: I didn't found anything useful to do such thing, However if you have some knowledge with C# or Visual Basic, you can develop a little program that will look in opened windows to find your command line and return the title for you. (using the PID of parent process (your cmd.exe))
In Powershell: (things are easy here)
Set window's title:
[system.console]::title = "Your New Title"
Get window's title:
$myTitleVar = [system.console]::title
or you can directly:
echo [system.console]::title
There's nothing built in, but you can retrieve it from the tasklist
command.
tasklist /fi "imagename eq cmd.exe" /fo list /v