Programming Field

Mountvol - DOS/Command Prompt Reference

[Windows 2000 or later] Performs the mounting and dismounting of volumes (hard disks).

Syntax

mountvol[.exe] [<drive>:]<path> { <volume-name> | /D | /L | /P }
mountvol[.exe] <drive>:[\] /S 
mountvol[.exe] { /R | /N | /E }
mountvol[.exe]

Options

When executed without parameters, the command displays an explanation of the command, a list of all mountable volumes, and a list of mount points. (If the EFI system partition is not mounted, no message regarding it will be displayed. If it is mounted, a message indicating ‘mounted’ will be shown.)

[<drive>:]<path> Specifies the destination drive and path (mount point) for mounting. If no drive is specified, it assumes the current drive. This path must be an existing directory.
<volume-name> Specifies the volume name to be mounted. The name specified here is chosen from the list displayed when Mountvol is executed without parameters.
/D Unmounts the mount at the specified path.
/L Displays a list of mount points mounted at the specified path.
/P [Windows Vista or later] Unmounts the mount at the specified path and also unmounts the volume itself. There should be no other mount points pointing to the same volume.
/R [Windows Vista or later] Deletes all paths (directories) where the destination volume is not present and removes corresponding registry settings.
/N [Windows Vista or later] Disables the automatic mounting of the new volume.
/E [Windows Vista or later] Enables the automatic mounting of the new volume.
/S

[Windows 8? or later] Mounts the EFI system partition to a drive.

When using this option, an unallocated drive must always be specified. It is not possible to specify a directory other than the root directory of the unallocated drive (the specified format must always be ‘mountvol X: /S’ or ‘mountvol X:\ /S’). Additionally, unmounting can be performed using the /D option as usual.

Details

Usage of Mountvol 1 Usage of Mountvol 2

It is a program used for mounting volumes in the Command Prompt. It can be considered as the command-line version of the Disk Management tool (‘diskmgmt.msc’).

The path (drive or directory) associated with a volume is referred to as a ‘mount point’. When using a directory as a mount point, the disk to which the directory belongs must be formatted with NTFS, and the contents of the directory must be empty.

To unmount a mount point, use the ‘/D’ option. Additionally, if the mount point is a directory, you can use the Rmdir command to delete the directory entirely (in this case, the contents of the volume will not be lost, but please be cautious as using the Del command may result in the loss of the volume's contents).

By executing Mountvol with the ‘/N’ option, automatic mounting of all new volumes, including USB disks, is disabled. However, for volumes that have been mounted at least once in the past, if the mount points (drive or directory) have not been explicitly unmounted (by using Mountvol or disk management utilities), reconnecting the volume will automatically mount it.

Due to the nature of the program, administrator privileges are required to perform mounting and dismounting.

Please note that Mountvol cannot mount virtual hard disk files (.vhd or .vhdx). You need to use Diskpart or PowerShell commands for that purpose.