@echo off
set domain=<DOMAIN NAME>
set password=<PASSWORD>
set server=<SERVER NAME or IP>
set user=<USER NAME>
cmdkey /generic:TERMSRV/%server% /user:%domain%\%user% /pass:%password%
start mstsc /v:%server% /f
exit /b
set domain=<DOMAIN NAME>
set password=<PASSWORD>
set server=<SERVER NAME or IP>
set user=<USER NAME>
cmdkey /generic:TERMSRV/%server% /user:%domain%\%user% /pass:%password%
start mstsc /v:%server% /f
exit /b