Remove


Applies To: Windows Server 2008 R2,Windows Server 2008,Windows 7,Windows Vista

Removes a drive letter or mount point from a volume.

For examples of how this command can be used, see Examples.

Syntax


Copy Code

remove [{letter=<d> | mount=<path> | all}] [dismount] [noerr]

Parameters

Parameter

Description

letter=<d>

Specifies the drive letter to be removed.

mount=<path>

Specifies the mount point path to be removed.

all

Removes all current drive letters and mount points.

dismount

Dismounts the basic volume, when all drive letters and mount points have been removed from the volume, and takes the basic volume offline, making it unmountable. If other processes are using the volume, DiskPart closes any open files in use by an application before dismounting the volume. You can make the volume mountable again by assigning it a driver letter or by creating a mount point path to the volume. Dismount will fail if used on a volume that has any remaining drive letters or mount points. For scripting, using remove all dismount is recommended.

noerr

For scripting only. When an error is encountered, DiskPart continues to process commands as if the error did not occur. Without this parameter, an error causes DiskPart to exit with an error code.

Remarks

Examples

To remove the drive letter K, type:


Copy Code

remove letter=k

To remove G:\MountH, type:


Copy Code

remove mount=G:\MountH

To remove all current drive letters and mount points, and dismount the volumes, type:


Copy Code

remove all dismount

Additional references

Command-Line Syntax Key

DiskPart