ANUNAYA THAKUR
ANUNAYA THAKUR
That holds good for any automation not only windows, the PC should not be locked. Either disable the lock or else use tscon.exe to login with the current user check...
in the pipeline create a batch file for tscon.exe and run it before you start your tests.
Why do you want to do that? you can just configure the agent in the pipeline, azure gives you the option. And configure the agent run at startup when you...
When you install the agent it gives you an option to run at startup then why do you want to manually run run.cmd from command line
Select yes for auto login 
https://techcommunity.microsoft.com/t5/healthcare-and-life-sciences/setup-azure-devops-self-hosted-agent-on-premise-amp/ba-p/3750154
Did it solved the issue?
get screenshot method give a full page screenshot?
What is shown in inspect.exe?
Can you post any code?