I am trying to mount an encrypted device made by Verarypt 1.19 by commands lines but when I hit the command, VeraCrypt main window opens, forcing me to click on Mount button and then insert the password. I want to automate the process:
cd "C:\Program Files\VeraCrypt"
veracrypt.exe /volume \?\Volume{b1e3e675-8ee8-4f2d-da94-c5c7ee22feb4}\ /letter h /password 123456 /silent /quit
Letter H is not being used in another device. The password is correct. The volume ID is correct because if I click on mount on the image bellow it ask for the password.
What I am doing wrong?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I can reproduce your problem, and all I can say is that the documentation now appears to be incorrect as far as v1.19 is concerned. However, using the \\?\Volume ... syntax, whether from the command line, or using the GUI and after one enters the password, mounting still fails with 'The system cannot find the file specified' error message.
You should use the \Device\Harddisk?\Partition? syntax (eg as in 'Select Device...' from the GUI).
PS I'm a bit puzzled how, if you used the /silent switch, the Veracrypt GUI opened. /silent supposedly 'suppresses interaction with the user (prompts, error messages, warnings, etc.)'
Last edit: Adrian Kentleton 2017-07-07
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I can not reproduce so there must be some other issue.
Can please remove "/silent" from the command line so that VeraCrypt can display the error that prevent it from mounting the volume?
One possibility is that there is a UNICODE encoding problem of your password when it is typed in the console. Try to use simple password to eliminate this possibility.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The ampersand in itself isn't the problem. I created a test file container (called 'ampersand'!), which mounted successfully with the following command line:
veracrypt /v F:\ampersand /p "word1 & word2" /q /l E
Acceptable characters in passwords is a can of worms generally, not just in Veracrypt. I had a discussion with another user back in January on Codeplex:
Give a try using a encrypted device instead of a file container, and use a 20 characters (like my password) with the & right in the middle, don't put spaces and don't use quotes.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Whether it's a file container or device hosted makes no difference. It's a Windows command line issue, nothing to do with VeraCrypt.as such
In the Windows command line, anything after an ampersand not enclosed in double quotes is interpreted as a separate command. It's how you can enter several commands on one line.
So, if I change the password of my test file container to 'word1&word2', this works fine:
veracrypt /v F:\ampersand /p "word1&word2" /l E /q
but this does not:
veracrypt /v F:\ampersand /p word1&word2 /l E /q
giving the error message:
word2 is not recognised as an internal or external command ...
although the password 'word1&word2' works fine if entered in the GUI.
If you use the unquoted password, Windows interprets what you've entered as two separate commands:
veracrypt /v F:\ampersand /p word1
word2
which fails to mount; and the GUI launches because it never gets to read the /q and /s switches!
I should have suspected an ampersand in your password straight away, because your GUI was launching despite the /s switch later in the command line (which did puzzle me).
Last edit: Adrian Kentleton 2017-07-07
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
OS: Windows 7 SP1 x64
VeraCrypt 1.19
Hi,
I am trying to mount an encrypted device made by Verarypt 1.19 by commands lines but when I hit the command, VeraCrypt main window opens, forcing me to click on Mount button and then insert the password. I want to automate the process:
cd "C:\Program Files\VeraCrypt"
veracrypt.exe /volume \?\Volume{b1e3e675-8ee8-4f2d-da94-c5c7ee22feb4}\ /letter h /password 123456 /silent /quit
Letter H is not being used in another device. The password is correct. The volume ID is correct because if I click on mount on the image bellow it ask for the password.
What I am doing wrong?
I can reproduce your problem, and all I can say is that the documentation now appears to be incorrect as far as v1.19 is concerned. However, using the \\?\Volume ... syntax, whether from the command line, or using the GUI and after one enters the password, mounting still fails with 'The system cannot find the file specified' error message.
You should use the \Device\Harddisk?\Partition? syntax (eg as in 'Select Device...' from the GUI).
PS I'm a bit puzzled how, if you used the /silent switch, the Veracrypt GUI opened. /silent supposedly 'suppresses interaction with the user (prompts, error messages, warnings, etc.)'
Last edit: Adrian Kentleton 2017-07-07
Tryed replacing the \?\Volume.. to \Device\Harddisk0\Partition1 that is shown on the GUI, but same problem yet...
Hi,
I can not reproduce so there must be some other issue.
Can please remove "/silent" from the command line so that VeraCrypt can display the error that prevent it from mounting the volume?
One possibility is that there is a UNICODE encoding problem of your password when it is typed in the console. Try to use simple password to eliminate this possibility.
I was too quick...the issue exists in 1.19 but it was fixed since then.
You can try 1.21-RC4 available at https://sourceforge.net/projects/veracrypt/files/VeraCrypt%20Nightly%20Builds/
1.21 is expected to be released tomorrow.
A quick thought - do you have a space in your password ie should it be enclosed in double quotes eg /p "pass word"?
Even in the 1.21-RC4 the problem happened. But I found what was: character & that was in my password. Remove it and the mount worked.
The & was causing strange spaces and wasn't accepting the quotes:
http://i.imgur.com/c6j2sLW.png
But, why with the & doesn't works? there are specifcs chars that we can't use? Or this is a bug?
Last edit: ragnolor 2017-07-07
The ampersand in itself isn't the problem. I created a test file container (called 'ampersand'!), which mounted successfully with the following command line:
veracrypt /v F:\ampersand /p "word1 & word2" /q /l E
Acceptable characters in passwords is a can of worms generally, not just in Veracrypt. I had a discussion with another user back in January on Codeplex:
https://veracrypt.codeplex.com/discussions/661045
Give a try using a encrypted device instead of a file container, and use a 20 characters (like my password) with the & right in the middle, don't put spaces and don't use quotes.
Whether it's a file container or device hosted makes no difference. It's a Windows command line issue, nothing to do with VeraCrypt.as such
In the Windows command line, anything after an ampersand not enclosed in double quotes is interpreted as a separate command. It's how you can enter several commands on one line.
So, if I change the password of my test file container to 'word1&word2', this works fine:
but this does not:
giving the error message:
although the password 'word1&word2' works fine if entered in the GUI.
If you use the unquoted password, Windows interprets what you've entered as two separate commands:
which fails to mount; and the GUI launches because it never gets to read the /q and /s switches!
I should have suspected an ampersand in your password straight away, because your GUI was launching despite the /s switch later in the command line (which did puzzle me).
Last edit: Adrian Kentleton 2017-07-07