Read text from a running command prompt

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Kangaxx
Posts: 2
Joined: 19 Jul 2017, 15:47

Read text from a running command prompt

19 Jul 2017, 17:00

Hello folks!

I want to read the text from a RUNNING command prompt in Windows and check if the text in it changed over time. If that is not the case, I want to kill that prompt and launch the .bat file again.
I want to make this clear: the script the prompt is running never comes to an end, therefore I can't send it to clipboard or print a .txt file trough it.
I tried to send the keys to select everything in the command prompt and to copy it, which are ^A {Enter}, but it's not working. :cry:
At this point I give up, I have read something about a program called cb.exe that supposedly does what I need but I have no clue about how to use it and if it works under Windows 64 bit.
I think I understood what to do next, but feel free to correct me, I'm not a programmer in life.

Loop
{
Something that copies the command prompt window content into clipboard

if (Myvar=Clipboard)
{
WinKill C:\WINDOWS\system32\cmd.exe
Run C:\whatever
}
Myvar:=Clipboard
Sleep 300000
}

In case you are wondering, I want to check if a miner program is running as intended, since it has a bad trend to get stuck without any error message. Yep, in Windows, I didn't plan this.
A viable option is to check the core usage of my GPU, but I think this is an harder task.
Thanks in advance
Kangaxx
Posts: 2
Joined: 19 Jul 2017, 15:47

Re: Read text from a running command prompt

20 Jul 2017, 13:04

Thanks for the reply, but as I said, the batch file launches a miner program, therefore, the batch file should never reach a line after the one that launches the miner.
The problem here is that I want to check the text at points where I can't use a |clip, because after the first line, the second should never happen.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: inseption86, mikeyww and 453 guests