Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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:

enter image description here

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:

enter image description here

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

share|improve this question
    
Sorry, @Tono, I cannot help you :-( I compared your mount commands for volumes W and Z and they truly only differ by that one letter. I also tried executing them on my PC and both worked. I can only sugegst that somehow volume W is in use, even though it looks free. Did you try dir w: what about other system utilities, such as easeus partition master? What does that show with erspect to drive W:? I am intruiged. If you find the naswer, please post it. –  Mawg Nov 8 '12 at 2:34
1  
Have you tried using instead of A:, that ugly device name e.g. \\?\Volume.. or \Device\Harddisk.. as seen in mountvol.exe... –  week Nov 8 '12 at 2:35
    
Maybe you could also try to ask at forums.truecrypt.org –  Mawg Nov 8 '12 at 2:35
    
Guys I am working on an edit thanks for the help. I noticed that this only happens sometimes... I am working on an edit... –  Tono Nam Nov 8 '12 at 2:41
    
It looks like you found a bug, so please report it and help others. –  Mawg Nov 9 '12 at 0:44

1 Answer 1

I submitted the bug report to trueCrypt. I found how to replicate the problem though. If you dismount a volume from a program that has no admin rights and then you try to mount the same volume into the same drive latter with a program that has admin rights it does not work. Same thing happens if you do it the otherway arrownd. So in short if you always mount and dismount without admin priviledges you are fine.

In my case I was creating a program that ran with admin privileges. And everytime I executed TrueCrypt.exe I had problems because trueCrypt.exe was running without admin privileges. What I have to do to solve the problem was to change:

enter image description here

now my program and trueCrypt.exe will both run with admin privileges and now I have no problems ;)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.