Failure to execute commands other than "pause" when run from task scheduler

Hey there team,

I have created a macro that goes around in desktop, opens up and closes some apps after a few clicks and it works like a charm when i manually “run” the task from scheduler. Same if i schedule it for a few minutes ahead and wait for it to run. But when i expect it to run at 12.03 (midnight) each day, it just fails on the first xclick or xtype (relative as well, i have tried everything). It does start, will run a pause i have at the beginning but then fails to do any other type of command. Let me know if you want to see the macro itself.

Ps. I am starting to think that since on the machine running the macro i have 2 users that remote connect to it, it may lock up the screen on the local machine and then ui has no image to run off or user is not logged in (on that machine) so all commands fail.

Ps2. Do you think that if i set the task to run “wheather user is logged in or not” (headless) it will succeed or is there a chance to fail catastrophically? It is kind of a critical process i’m trying to automate so i would appreciate being able to see what is going on if needed.

Your analysis is correct: The issue is that all visual automation commands (XClick, XClickText, visualAssert, aiComputerUse,…) need an unlocked desktop. Otherwise Ui.Vision can not take screenshots and thus the commands report an error.

=> See this info:

1 Like

Thank you for your reply! So we can narrow it down to the remote sessions locking up the system.
Unfortunately this system and the apps I run there concern financial services and i cannot really create a vm and clone everything in it as that would be a huge hustle and would require third party support for the software used… Additionally for the very same reason i should not enable the option to log in this user without a password so autologin will be my last choice. Do you thing there might be another way around it?

Edit: I see tscon might be the only route for me at this point. I will give it a go

Another good option is to use 3rd party remote desktop software instead of Microsoft RDP. When you use e. g. VNC, Teamviewer or Anydesk* and then disconnect, the desktop service does not get closed and Ui.Vision can continue to take screenshots! For some reason, only RDP stops the desktop process upon disconnection.

PS: I tested all 3: VNC, Teamviewer and Anydesk. All work fine for use with Ui.vision and other automation software. Currently I use Anydesk.

1 Like

@ulrich :index_pointing_at_the_viewer: :star2:
You know when you overthink a solution but the answer was right there? That’s what happened. This worked! I do prefer the quality of RDP over 3rd party solutions but I can just have the last connection of the day be through Anydesk and have the machine ready for the midnight RPA task.
Fun fact when i first created the macro i used to connect through anydesk and it used to work. It only started to misbehave when i changed to RDP and i never connected the dots.
I do feel like a fool now for missing this solution all this time :sweat_smile:

The issue is solved for me but in all fairness both answers provided are correct so i do not know who should get the solve…

Putting it all together, i could create a macro on an other machine that would open an anydesk connection to the remote machine 5-10 mins before midnight so i don’t have to worry about it at all.