3

Is it possible, in a Windows batch file, to test if a certain drive letter was mounted by TrueCrypt?

Andreas Spindler
  • 7,568
  • 4
  • 43
  • 34

2 Answers2

3

I think this is not possible. You could get much information with wmic logicaldisk but nothing will indicate that Truecrypt assigned the drive letter.

Benoit
  • 76,634
  • 23
  • 210
  • 236
  • 2
    I share this assumption. There's a simple trick which I'm using currently. Create a static, empty file `MOUNTED_BY_TRUECRYPT` in the root of file container. In the batch file then test `if exist %DRIVE%\MOUNTED_BY_TRUECRYPT ( ...`. This trick is simple and plausible, and it can be used for other logical drive types too. – Andreas Spindler Sep 20 '11 at 12:08
0

As an Idea: (for anyone still finding this post)

You could make this C# Script over at the post #18021118 (which accesses truecrypt to retrive mount information) (there is also a VeraCrypt version over there.) ...

  1. into a commandline tool to be used from your windows batch (added a simple example here: http://github.com/BananaAcid/VeraCrypt-Cmd - replace the get mounts file with the one from the readme within)
  2. or use it directly with powershell
  3. or with an additional binary wich executes scripts on the windows NET Framework without compiling: cs-script.
BananaAcid
  • 3,221
  • 35
  • 38
  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - [From Review](/review/low-quality-posts/19413896) – Bonatti Apr 12 '18 at 16:39
  • Your comment seems invalid. Since it is referenced within the stackoverflow ecosystem. And the whole thread would need to be replicated here, which does seem to much. – BananaAcid Apr 19 '18 at 18:07