大网数据广告活动
Windows排障命令

change port

· 52CE 我爱测

Reference article for the change port command, which lists or changes the COM port mappings to be compatible with MS-DOS applications.

Lists or changes the COM port mappings to be compatible with MS-DOS applications.

Note: To find out what's new in the latest version, see What's New in Remote Desktop Services in Windows Server.

Syntax

change port [<portX>=<portY>| /d <portX> | /query]

Parameters

Parameter Description
<portX>=<portY> Maps COM <portX> to <portY>
/d <portX> Deletes the mapping for COM <portX>
/query Displays the current port mappings.
/? Displays help at the command prompt.
Remarks
  • Most MS-DOS applications support only COM1 through COM4 serial ports. The change port command maps a serial port to a different port number, allowing apps that don't support high-numbered COM ports to access the serial port. Remapping works only for the current session and is not retained if you log off from a session and then log on again.

  • Use change port without any parameters to display the available COM ports and their current mappings.

Examples

  • To map COM12 to COM1 for use by an MS-DOS-based application, type:

    change port com12=com1
    
  • To display the current port mappings, type:

    change port /query
    

Related links

Source: Microsoft Learn / Windows Server documentation by Microsoft and contributors (upstream author metadata: robinharwood). Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / Windows Server documentation
适用范围
Windows Server · Source date 10/16/2017
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。