I built a program that will connect to a list of remote machines through Windows. The only issue I'm having is that after it connects to the Remote Desktop the Windows command prompt is in a "frozen state" until I disconnect from the remote. At the point it loops the code back where you can select another machine.
I want it to be able to loop back without having to disconnect so I can connect to multiple machines.
Here is my code:
:deployCode
cmdkey /generic:"SERVERNAME" /user:"user" /pass:"password"
mstsc /v:"SERVERNAME"
cls
goto :machinelist
It doesn't step through the cls clear command and go back to my machine list (goto :machinelist
) until I close the server I connect to.
I tried using "&" to join the two commands but that did not work.
i.e mstsc /v:"SERVERNAME" & goto :machinelist
How can I step to cls and goto :machinelist without having to disconnect after mstsc?