1

I'm trying to format whole USB from windows commandline. In Linux it's quite easy - veracrypt --create diskPath

But when i'm trying to do that in windows it's impossible.

I'm trying to use this command

"VeraCrypt Format.exe" /create \\?\Volume{ad4200bf-2236-11e8-9b79-bcee7b594766}\ /password test /size 100M

Also this:

"VeraCrypt Format.exe" /create F: /password test /size 100M

Also - i want to encrypt whole partition, not only 100M, but i can't execute /craete without /size

Razikus
  • 146
  • 2
  • 12
  • So what happens? Nothing, an error message apperars, something else? – vonPryz Jun 16 '18 at 12:06
  • It tries to create volume F:, and there is an error - file exists. In my opinion - it tries to create an volume in argument, not crypt whole partition – Razikus Jun 16 '18 at 13:15
  • If `/create` takes a filename, _which indicates the container file to create_, then it follows that a drive is not a file! Additionally for `/size` you should be able to determine the available size of the drive first, then use a value for that container file additionally suffixed with `K`, `M`, `G` or `T` as necessary. – Compo Jun 16 '18 at 14:47
  • You may be able to do it using the built-in BitLocker and manage it via `cscript "%__AppDir__%manage-bde.wsf"`. Run that command at the prompt to view it's options. – Compo Jun 16 '18 at 14:56
  • cscript "%__AppDir__%manage-bde.wsf" not working. Also - i want to use option "Encrypt nonsystem partition or disk" - it's doable via GUI, but i can't manage to do it via command line. – Razikus Jun 17 '18 at 08:15

1 Answers1

1

VeraCrypt format command goes like this:

"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]

Now what you were trying should go like the below. You are missing the path or the subset of the parameters.

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

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

And if you want to mount that automatically, then it should go like this: Mount a volume called testvolume.tc using the password test, as the drive letter X.

veracrypt /v testvolume.tc /l x /a /p test /e /b

Refer the source LINK for details.

Hope it helps.

Ranadip Dutta
  • 8,857
  • 3
  • 29
  • 45
  • 1
    I don't want to create a volume on disk, but crypt whole disk. – Razikus Jun 17 '18 at 08:11
  • This is a very thorough and correct answer for how to create an encrypted file container, but OP has asked about how to encrypt a full non-system drive from the command line. – JonathanDavidArndt Jul 08 '18 at 03:52