TrueCrypt drive letter not available
- by Tono Nam
With c# or a batch file I mount a trueCrypt volume located at A:\volumeTrueCrypt.tc
With c# I do:
static void Main(string[] args)
{
var p = Process.Start(
fileName:@"C:\Program Files\TrueCrypt\TrueCrypt.exe",
arguments:@"/v a:\volumetruecrypt.tc /lw /a /p truecrypt"
);
p.WaitForExit();
}
the alternative is to run the command on the command line as:
C:\Windows\system32>"C:\Program Files\TrueCrypt\TrueCrypt.exe" /v "a:\volumetruecrypt.tc" /lw /a /p truecrypt
Either way I get the error:
Why do I get that error? I was able to run that command the first time. The moment I dismounted the volume and tryied to mount it again I got that error. I know that drive letter W is available because it shows as an available letter on true crypt if I where to open it manually:
If I where then click on the button mount and then type the password truecrypt (truecrypt is the password) then it will successfully mount on drive w. Why I am not able to mount it from the command line!? If I change the drive letter on the command line it works. I want to use the drive W though. In other words executing
"C:\Program Files\TrueCrypt\TrueCrypt.exe" /v "a:\volumetruecrypt.tc" /lz /a /p truecrypt
will successfully mount that volume on drive z but I do not want to mount it on drive z I want to mount it on drive w. The first time I ran the batch it ran fine. Also if I restart my computer I believe it should work. More info on how to use trueCrypt through the command line can be found at: http://www.truecrypt.org/docs/?s=command-line-usage
Edit
I was also investivating when does this error occures. In order to generate this error you need to follow this steps.
1) execute the command: (note the /q argument at the end for quiet)
"C:\Program Files\TrueCrypt\TrueCrypt.exe" /v "a:\volumetruecrypt.tc" /ln /a /p truecrypt /q
"C...TrueCrypt.exe" = location where trueCrypt is located
/v "path" = location where volume is located
/n = drive letter n
/p truecrypt = password is "trueCrypt"
/q = execute in quiet mode. do not show window
note I am mounting to drive letter n
2) now volume should be mounted.
3) Open trueCrypt and manually dismount that volume (without using command line)
4) Attempt to run the same command line (without the /q so you see the error)
"C:\Program Files\TrueCrypt\TrueCrypt.exe" /v "a:\volumetruecrypt.tc" /ln /a /p truecrypt
5) an error should show up
So the problem ocures when I manually dismount the volume. If I dismount it from the command line I get no errors. But I think this is a bug from trueCrypt