RDP connection by making it .bat file

I want to automate the RDP connection by making a bat file. But it still keeps on asking me the password.

I created two files 1.hello.cmd 2.hello1.bat

In hello.cmd I had put

cmdkey /generic:"ipaddress" /user:"username" /pass:"password"
rem cmdkey /generic:TERMSRV:"ipaddress" /user:"username" /pass:"password"

and in hello1.bat I created

mstsc /v:ipaddress

How do i correct this and make it automate

Please help!!!

1 Answer

This functionality was removed from the mstsc.exe application. I think you may do either of:

  • Save from RDP the connection details as an .rdp file and launch it directly or via mstsc.

  • Use PowerShell, for example the scriptConnect-Mstsc.ps1. You will find some more information onthis post, google for details on individual commands.

2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like