All,
Sorry if this question is asked before, but i could not find this when searching.
I have AHK open a PuTTY session in which it runs a script
When the script is finished, the PuTTY prompt (from the server i logged into) appears again.
I want AHK to see when the prompt is there, and when it is use WinClose to close the PuTTY window
- So something like ; If prompt in PuTTY window (user@server) is true / present, then WinClose PuTTY
Up till now i have not been able to find an answer that fits
If any of you can advise this is much appreciated
Kind regards,
Paul
Close a Putty window when prompt is detected
- Thoughtfu1Tux
- Posts: 125
- Joined: 31 May 2018, 23:26
Re: Close a Putty window when prompt is detected
Here’s what I do with my RaspberryPi and Putty:
Code: Select all
ToolTip, Press "0" to Exit, 850, 0
KeyWait, 0, D
WinWait, PuTTY Fatal Error, , 3 ; Window title when connection force closes when I reboot my Pi
WinClose, PuTTY Fatal Error, , 1
WinClose, PuTTY (inactive), , 1
Re: Close a Putty window when prompt is detected
.
Thanks for the reply
However, this still needs manual action
I want the putty window to close automatically when a certain prompt is detected
I found something like PuttyWait(PPid, WatchText)
But can't seem to get it to work in conjunction with WinClose
Thanks in advance for any ideas
Paul
Thanks for the reply
However, this still needs manual action
I want the putty window to close automatically when a certain prompt is detected
I found something like PuttyWait(PPid, WatchText)
But can't seem to get it to work in conjunction with WinClose
Thanks in advance for any ideas
Paul
Re: Close a Putty window when prompt is detected
You may need to run your script that is trying to use WinClose elevated. (run as admin)
HTH
HTH
Re: Close a Putty window when prompt is detected
Xtra,
That would be not the case
I can use WinClose with WinSetTitle for example
WinSetTitle, Old window Title , New Window Title
WinClose, New Window Title,
This works, the window closes
But i wonder if PuttyWait is supported in all AHK versions as i can hardly find any info on this
Paul
That would be not the case
I can use WinClose with WinSetTitle for example
WinSetTitle, Old window Title , New Window Title
WinClose, New Window Title,
This works, the window closes
But i wonder if PuttyWait is supported in all AHK versions as i can hardly find any info on this
Paul
Re: Close a Putty window when prompt is detected
There was never a specific AHK-built-in function called PuttyWait... it has to be some user-defined function and you will have to include its code in your script to be able to use it... if it is supported by the AHK version you are using is not really to tell without seeing its code, but likely yes.
Who is online
Users browsing this forum: hedehede81 and 283 guests