Cool use of Batch Scripting webfork. I tend to use a custom AutoIt Script (which I haven't released publicly.)
This is my poor attempt at creating a Batch Script, place in the same location as TrueCrypt.exe or change
"Set TrueCrypt" &
"Set Path". It works in that when you double-click on the Batch File (e.g. Mount.bat,) it will Mount the TrueCrypt Container, if the Batch File (e.g. Mount.bat,) is double-clicked again it will automatically Dismount. Another feature is if you add
EjectUSB to the same directory as TrueCrypt and remove
"REM" on the line that executes
EjectUSB in Dismount, this will close all programs running from the Drive (e.g. Y:\)
Plus, if you remove
"REM" from
"Del %0" it will delete the Batch File on Dismount, it might be useful for someone?! :S
Code: Select all
@ECHO OFF
Set Drive=Y
Set Path="TrueCrypt"
Set TrueCrypt="TrueCrypt.exe"
Set EjectUSB="EjectUSB.exe"
IF EXIST %Drive%: GoTo Dismount
GOTO Mount
:Dismount
REM START /WAIT %EjectUSB% %Drive%:\
%TrueCrypt% /d %Drive% /f /w /q /s
REM Del %0
Exit
:Mount
%TrueCrypt% /v /l %Drive% %Path% /m rm /m ts /q /e
Source: http://www.truecrypt.org/docs/?s=command-line-usage