detach vdiskdetach vdisk

适用于: Windows Server (半年通道) ,Windows Server 2019,Windows Server 2016,Windows Server 2012 R2,Windows Server 2012Applies to: Windows Server (Semi-Annual Channel), Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012

停止所选虚拟硬盘 (VHD) 在主计算机上显示为本地硬盘驱动器。Stops the selected virtual hard disk (VHD) from appearing as a local hard disk drive on the host computer. 分离 VHD 后,可以将其复制到其他位置。When a VHD is detached, you can copy it to other locations. 在开始之前,必须选择 VHD 才能使此操作成功。Before you begin, you must select a VHD for this operation to succeed. 使用 " 选择 vdisk " 命令选择 VHD 并将焦点移动到该 VHD。Use the select vdisk command to select a VHD and shift the focus to it.

语法Syntax

detach vdisk [noerr]

参数Parameters

参数Parameter 说明Description
noerrnoerr 仅用于脚本。For scripting only. 出现错误时,DiskPart 继续处理命令,就像未发生错误一样。When an error is encountered, DiskPart continues to process commands as if the error did not occur. 如果没有此参数,则错误会导致 DiskPart 退出并出现错误代码。Without this parameter, an error causes DiskPart to exit with an error code.

示例Examples

要分离所选 VHD,请键入:To detach the selected VHD, type:

detach vdisk

其他参考Additional References