文章目录
1. 按
对于经常使用的远程桌面连接命令mstsc远程管理电脑或者服务器的人来说,远程桌面连接命令mstsc的使用很简单。但是对于从来没有接触过远程桌面连接命令的人来说,首次使用可能连需要进行设置都不清楚。我们这里将远程桌面连接命令mstsc的使用方法进行详细介绍。远程桌面连接命令mstsc使用前需要进行设置。
- 官方文档
- 更多关于远程桌面的连接方法,可以参考:基于IPv6的Windows 3389端口远程桌面使用方法,从此告别第三方远程控制软件
2. 用法实例
2.1. 以全屏模式打开远程桌面
echo 使用IPv4地址
mstsc /v:192.168.1.2 /f
echo 使用域名
mstsc /v:7.coco56.top /f
echo 使用计算机名
mstsc /v:computer1 /f
mstsc /f
2.2. 指定长和宽
mstsc /v:computer1 /w:1920 /h:1080
2.3. To open a file called filename.rdp for editing
mstsc /edit filename.rdp
2.4. 编写bat脚本
编写bat脚本时,命令最好前面加一个start
,否则CMD窗口会一直保留到你所连接的远程会话结束,具体命令如:
start mstsc /v:7.coco56.top /f
编写bat脚本使用是非常方便的,直接双击一下脚本文件就可以了。
3. 语法详解
mstsc.exe [<connectionfile>] [/v:<server>[:<port>]] [/admin] [/f] [/w:<width> /h:<height>] [/public] [/span]
mstsc.exe /edit <connectionfile>
mstsc.exe /migrate
Parameter | Description |
---|---|
<connectionfile> | Specifies the name of an .rdp file for the connection. |
/v:<server>[:<port>] | Specifies the remote computer and, optionally, the port number to which you want to connect. |
/admin | Connects you to a session for administering the server. |
/f | Starts Remote Desktop Connection in full-screen mode. |
/w:<width> | Specifies the width of the Remote Desktop window. |
/h:<height> | Specifies the height of the Remote Desktop window. |
/public | Runs Remote Desktop in public mode. In public mode, passwords and bitmaps aren’t cached. |
/span | Matches the Remote Desktop width and height with the local virtual desktop, spanning across multiple monitors if necessary. |
/edit <connectionfile> | Opens the specified .rdp file for editing. |
/migrate | Migrates legacy connection files that were created with Client Connection Manager to new .rdp connection files. |
/? | Displays help at the command prompt. |
- Default.rdp is stored for each user as a hidden file in the user’s Documents folder.
- User created .rdp files are saved by default in the user’s Documents folder, but can be saved anywhere.
- To span across monitors, the monitors must use the same resolution and must be aligned horizontally (that is, side-by-side). There is currently no support for spanning multiple monitors vertically on the client system.