Remote Desktop - VPN & RDP Command 3/17/2010 All Remote Desktop posts

If you're always connecting to a VPN for the purpose of RDPing into a machine, try saving this script as a *.cmd and run it

rasdial "VPN" /d

rasdial "VPN" username password

route delete AAA.AAA.AAA.AAA

route add AAA.AAA.AAA.AAA mask BBB.BBB.BBB.BBB CCC.CCC.CCC.CCC

mstsc.exe /v:XXX.XXX.XXX.XXX /f

exit /b
Key
Any route you might need, skip this if you don't need them
Route Mask
The name of your VPN Connection
username and password of your VPN Connections

What this will do is connect to a named VPN, add any routes you need, then call the Microsoft Terminal Services Client. If you've connected to that IP Address via RDP before and saved your credentials you won't have to enter them.