window批处理文件调用远程服务器

新建一个文本,将名字改为test_mstsc,修改后缀名为.bat文件。文件内容如下

@Echo off
rem set remote server address.
Set SERVER=192.168.0.100
rem set remote server username.
Set USERNAME=remoteuser
rem set remote server password.
Set PASSWORD=remotepassword

rem start remote server.
Cmdkey /generic:TERMSRV/%SERVER% /user:%USERNAME% /pass:%PASSWORD%
Start mstsc /v:%SERVER%
rem tomeout 2ms delete server cert.
rem Timeout 2
rem Cmdkey /delete:TERMSRV/%SERVER%

 

posted @ 2021-09-30 16:38  IT民工郑小江  阅读(305)  评论(0编辑  收藏  举报