:: Next line removes surrounding quotes from server name :: Check if the user passed at least 1 argumentĮcho Remoted Desktop connection with user and passwordĮcho %~nx0% “servername” “username” “password”
I didn’t like the idea of leaving the user and pass in the password vault so it clears it after 120 seconds (leaves a command prompt window opened). txt at the end!)Ĭall it from the command line as follows:
Save this a mstscup.cmd from notepad (don’t forget to remove the.
I found this cmdkey /generic:TERMSRV/$server /user:$user /pass:$Passwordīut I think that's for powershell only and I'm inexperienced with windows.įor people that were looking for this idea but want to use batch instead I created the following.