Batch file logs into remote desktop, but stops at interactive logon message

516 views Asked by At

I've got this script in a batch file:

cmdkey /generic:"servername" /user:"user id" /pass:"password"
mstsc /v:"servername"

...which logs me into a remote server (remote desktop session). It works great, but doesn't actually log me in all of the way because this server is configured with an interactive logon, meaning there is a message that comes up that I have to click OK to when I first connect before it actually signs in all of the way.

We have a problem with our admins shutting down this server at night to apply updates and thus logging us out - causing our scheduled tasks to not refresh. I want to assign this batch file to a scheduled task on my local PC to ensure that every morning, before my scripts run, I'm logged back into the server.

Is there a way to get this batch file to bypass/acknoweldge this message so it finishes signing me in?

0

There are 0 answers