VeraCrypt

Documentation >> Command Line Usage

Command Line Usage

Note that this section applies to the Windows version of VeraCrypt. For information on command line usage applying to the Linux and Mac OS X versions, please run: veracrypt –h

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup />
</Project>
/help or /? Display command line help.
/truecrypt or /tc Activate TrueCrypt compatibility mode which enables mounting volumes created with TrueCrypt 6.x and 7.x series.
/hash It must be followed by a parameter indicating the PRF hash algorithm to use when mounting the volume. Possible values for /hash parameter are: sha256, sha-256, sha512, sha-512, whirlpool, ripemd160 and ripemd-160. When /hash is omitted, VeraCrypt will try all possible PRF algorithms thus lengthening the mount operation time.
/volume or /v

It must be followed by a parameter indicating the file and path name of a VeraCrypt volume to mount (do not use when dismounting) or the Volume ID of the disk/partition to mount.
The syntax of the volume ID is ID:XXXXXX...XX where the XX part is a 64 hexadecimal characters string that represent the 32-Bytes ID of the desired volume to mount.

To mount a partition/device-hosted volume, use, for example, /v \Device\Harddisk1\Partition3 (to determine the path to a partition/device, run VeraCrypt and click Select Device). You can also mount a partition or dynamic volume using its volume name (for example, /v \\?\Volume{5cceb196-48bf-46ab-ad00-70965512253a}\). To determine the volume name use e.g. mountvol.exe. Also note that device paths are case-sensitive.

You can also specify the Volume ID of the partition/device-hosted volume to mount, for example: /v ID:53B9A8D59CC84264004DA8728FC8F3E2EE6C130145ABD3835695C29FD601EDCA. The Volume ID value can be retrieved using the volume properties dialog.

matically perform requested actions and exit (main VeraCrypt window will not be displayed). If preferences is specified as the parameter (e.g., /q preferences), then program settings are loaded/saved and they override settings specified on the command line. /q background launches the VeraCrypt Background Task (tray icon) unless it is disabled in the Preferences. /silent or /s If /q is specified, suppresses interaction with the user (prompts, error messages, warnings, etc.). If /q is not specified, this option has no effect. /mountoption or /m

It must be followed by a parameter which can have one of the values indicated below.

ro or readonly: Mount volume as read-only.

rm or removable: Mount volume as removable medium (see section Volume Mounted as Removable Medium).

ts or timestamp: Do not preserve container modification timestamp.

sm or system: Without pre-boot authentication, mount a partition that is within the key scope of system encryption (for example, a partition located on the encrypted system drive of another operating system that is not running). Useful e.g. for backup or repair operations. Note: If you supply a password as a parameter of /p, make sure that the password has been typed using the standard US keyboard layout (in contrast, the GUI ensures this automatically). This is required due to the fact that the password needs to be typed in the pre-boot environment (before Windows starts) where non-US Windows keyboard layouts are not available.

bk or headerbak: Mount volume using embedded backup header. Note: All volumes created by VeraCrypt contain an embedded backup header (located at the end of the volume).

recovery: Do not verify any checksums stored in the volume header. This option should be used only when the volume header is damaged and the volume cannot be mounted even with the mount option headerbak. Example: /m ro

label=LabelValue: Use the given string value LabelValue as a label of the mounted volume in Windows Explorer. The maximum length for LabelValue  is 32 characters for NTFS volumes and 11 characters for FAT volumes. For example, /m label=MyDrive will set the label of the drive in Explorer to MyDrive.

Please note that this switch may be present several times in the command line in order to specify multiple mount options (e.g.: /m rm /m ts)

VeraCrypt Format.exe (VeraCrypt Volume Creation Wizard):

/create Create a container based volume in command line mode. It must be followed by the file name of the container to be created.
/size

(Only with /create)
It must be followed by a parameter indicating the size of the container file that will be created. This parameter is a number indicating the size in Bytes. It can have a suffixe 'K', 'M', 'G' or 'T' to indicate that the value is in Kilobytes, Megabytes, Gigabytes or Terabytes respectively. For example:

  • /size 5000000: the container size will be 5000000 bytes
  • /size 25K: the container size will be 25 KiloBytes.
  • /size 100M: the container size will be 100 MegaBytes.
  • /size 2G: the container size will be 2 GigaBytes.
  • /size 1T: the container size will be 1 TeraBytes.
 /password  (Only with /create)
It must be followed by a parameter indicating the password of the container that will be created.
 /hash (Only with /create)
It must be followed by a parameter indicating the PRF hash algorithm to use when creating the volume. It has the same syntax as VeraCrypt.exe.
/encryption (Only with /create)
It must be followed by a parameter indicating the encryption algorithm to use. The default is AES if this switch is not specified. The parameter can have the following values (case insensitive):
  • AES
  • Serpent
  • Twofish
  • AES(Twofish)
  • AES(Twofish(Serpent))
  • Serpent(AES)
  • Serpent(Twofish(AES))
  • Twofish(Serpent)
/filesystem (Only with /create)
It must be followed by a parameter indicating the file system to use for the volume. The parameter can have the following values:
  • None: don't use any filesystem
  • FAT: format using FAT/FAT32
  • NTFS: format using NTFS. Please note that in this case a UAC prompt will be displayed unless the process is run with full administrative privileges.
/dynamic (Only with /create)
It has no parameters and it indicates that the volume will be created as a dynamic volume.
/force (Only with /create)
It has no parameters and it indicates that overwrite will be forced without requiring user confirmation.
/silent (Only with /create)
It has no parameters and it indicates that no message box or dialog will be displayed to the user. If there is any error, the operation will fail silently.
/noisocheck or /n Do not verify that VeraCrypt Rescue Disks are correctly burned. WARNING: Never attempt to use this option to facilitate the reuse of a previously created VeraCrypt Rescue Disk. Note that every time you encrypt a system partition/drive, you must create a new VeraCrypt Rescue Disk even if you use the same password. A previously created VeraCrypt Rescue Disk cannot be reused as it was created for a different master key.

Syntax

VeraCrypt.exe [/tc] [/hash {sha256|sha-256|sha512|sha-512|whirlpool |ripemd160|ripemd-160}][/a [devices|favorites]] [/b] [/c [y|n|f]] [/d [drive letter]] [/e] [/f] [/h [y|n]] [/k keyfile or search path] [tryemptypass [y|n]] [/l drive letter] [/m {bk|rm|recovery|ro|sm|ts}] [/p password] [/pim pimvalue] [/q [background|preferences]] [/s] [/tokenlib path] [/v volume] [/w]

"VeraCrypt Format.exe" [/n] [/create] [/size number[{K|M|G|T}]] [/p password]  [/encryption {AES | Serpent | Twofish | AES(Twofish) | AES(Twofish(Serpent)) | Serpent(AES) | Serpent(Twofish(AES)) | Twofish(Serpent)}] [/hash {sha256|sha-256|sha512|sha-512|whirlpool|ripemd160|ripemd-160}] [/filesystem {None|FAT|NTFS}] [/dynamic] [/force] [/silent]

Note that the order in which options are specified does not matter.

Examples

Mount the volume d:\myvolume as the first free drive letter, using the password prompt (the main program window will not be displayed):

veracrypt /q /v d:\myvolume

Dismount a volume mounted as the drive letter X (the main program window will not be displayed):

veracrypt /q /d x

Mount a volume called myvolume.tc using the password MyPassword, as the drive letter X. VeraCrypt will open an explorer window and beep; mounting will be automatic:

veracrypt /v myvolume.tc /l x /a /p MyPassword /e /b

Create a 10 MB file container using the password test and formatted using FAT:

"C:\Program Files\VeraCrypt\VeraCrypt Format.exe" /create c:\Data\test.hc /password test /hash sha512 /encryption serpent /filesystem FAT /size 10M /force