Program using screenshots on Windows 10 server errors upon SSH disconnection

21 Views Asked by At

I have a Python program running on a Windows 10 server hosted online, which locates specific icons using screenshots. The program uses image recognition to identify these icons. However, when I disconnect from SSH, the program errors out due to the absence of an active screen.

How can I allow it to function even when not directly connected via SSH, ensuring it can continue locating and interacting with these icons/ the screen?

1

There are 1 best solutions below

0
Zale On

https://superuser.com/questions/735442/stay-logged-in-while-rdp-session-is-over

the marked answer worked for me

tscon 1 /dest:console ; Start-Process -FilePath "C:\Users\admin\AppData\Local\Programs\Python\Python311\python.exe" -ArgumentList '"C:\Users\admin\Desktop\script\script.py"'