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.

Considering the command: TrueCrypt.exe /q /e /v "dummy.tc"

1: Is there a way to dismount dummy.tc from the command line WITHOUT knowing its drive letter?

2: Is there a way to discover, after this command has executed, what drive letter dummy.tc was attached to?


Backstory:

I'm implementing a site-wide TrueCrypt deployment for our hundreds of thumbdrives used throughout the engineering team. It's quite common for a user to have upwards of a half-dozen thumbdrives sticking out of a computer at any given moment, as they need to update multiple machines simultaneously. My test rig has eleven(!) drives hanging out of it right now. That's a hard limit due to drive letter collisions, but the staff thinks it's a reasonable number.

A simple batch script included on every drive will iterate through all the *.tc volumes on a stick and mounts them individually via keyfiles and/or password prompts.

My documentation calls for users to selectively dismount a volume before ejecting the drive it resides on, but it's becoming a headache to keep the stick-volume-driveletter relations straight. I've accidentally slagged a volume already this morning by ejecting the wrong drive, and I have no faith that my users will be any better at keeping things straight.

A simple solution would be to have another batch script on each drive that would find all the volumes on that stick, dismount them, and eject the drive. However, as the volumes are attached to the next available driveletter, and TC only provides a simple exit code, I don't seem to have any way to find out what letter TC used. Dismount all isn't an option either, as it's quite likely a user would have files open on other volumes.

Any TC experts ever encounter a problem like this? Any suggestions?

share|improve this question
    
The documentation for /dismount or /d says "When no drive letter is specified, dismounts all currently mounted TrueCrypt volumes", so I don't think you can do what you want directly. –  martineau Dec 10 '12 at 21:47
    
I was afraid of that. I suppose I'll have to rig up a drive enumerator and track the letters myself. –  Ed Penwell Dec 11 '12 at 12:34
    
I just always mount my volumes using specific reserved drive letters in my script, so I always know which ones to use to dismount them. If you can't do that, then enumerating them is probably you're only recourse. –  martineau Dec 11 '12 at 17:34
    
Perhaps you could create a file with a unique name on each thumbdrive and test for its existence on every possible drive letter in your script, which could be done relatively easily in a batch file. –  martineau Dec 11 '12 at 17:47
add comment

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.