I have to work on 2 simultaneous rdp connections on two screens
and every 5/10 minutes or so one of them got locked (you know: security policies...)
so I ended up with this workaround: a simple infinite-loop python script that
I can launch in a local cmd shell:
every minute it simulates a click and an Esc key in both rdp window (and this, in my specific case, cannot cause any harm, but beware: YMMV)
import pyautogui, random, sys
from tkinter import Tk
from time import sleep
pyautogui.PAUSE = 0.01
num_times = 0
while True:
num_times += 1
print("loop number %d" % num_times)
sleep(1)
print(".")
sleep(1)
print(".")
z1, z2 = pyautogui.position()
pyautogui.moveTo(-700, 300, duration=0.1)
pyautogui.click()
sleep((0.4 + random.random()) / 4)
pyautogui.hotkey("esc")
pyautogui.moveTo(z1, z2, duration=0.1)
pyautogui.click()
sss = 48.4 + 6.01 * random.random()
print("sleeping for %d s " % int(sss))
sleep(sss)
print("this statement just marks the script end, but it won't be ever executed")
No comments:
Post a Comment