How to stop windows server from stopping keyboard input when I disconnect?

18 Views Asked by At

I'm trying to use a macro on my windows server, the macros run just fine whenever I am connected via remote desktop, but as soon as I close my connection, it stops inputting from my macro. I used a macro recorder program at first and then moved to just writing my own Python script using pyautogui but still whenever I close the remote desktop connection, it stops typing (the python script does continue running though).

So what I'm asking is there anyway for my windows server to act like there is a remote desktop connection 24/7 or at least just continue allowing keyboard input from my Python script.

Here is an example of the script I'm using:

import pyautogui
import time

print('Typing in 10 seconds.')
while True:
    time.sleep(10)
    pyautogui.typewrite('type stuff here')
    pyautogui.press('enter')
    time.sleep(60)
    pyautogui.typewrite('type different stuff here')
    pyautogui.press('enter')
    time.sleep(140)
    pyautogui.hotkey('ctrl', 'c')
0

There are 0 best solutions below