I am using a virtual private server (VPS) running Windows Server 2012 R2 Base on Amazon web services (AWS)
I am using Python imaging library and win32api to simulate mouse clicks and take screenshots.
I would like to be able to do this even when the remote desktop is not connected.
As soon as I disconnect there is no monitor available and my python program stops because it cannot click anywhere (there is no screen to click on)
Is there a way to setup a "fake" monitor or display for my VPS so it can continue to click away happily?
This is possible through the tscon command - where you can disconnect from the RDP session but the terminal is still available. I am not sure whether this will work for your python program.
The command is tscon, an example of the use is:
C:\Windows\System32\tscon.exe rdp-tcp#1 /dest:console
This depends on knowing the RDP session identifier (rdp-tcp#1 in this case). If you use the qwinsta command in a command shell. As seen below this shows the currently active session name for use in the tscon command. One issue is that each time you RDP in the session increments so you have to use the new session name each time.
C:\Users\Administrator>qwinsta
SESSIONNAME USERNAME ID STATE TYPE DEVICE
services 0 Disc
>rdp-tcp#1 Administrator 2 Active
console 3 Conn
rdp-tcp 65536 Listen