Some of us use Truecrypt for storing our files in an isolated partition and might be less concerned on its security (Update: check the details at the end of this post). For example, my thumbdrive has a single encrypted file created with Truecrypt which I always mount it in W: drive, which helps me to run many of the non-portable apps in portable mode. Another possible reason, to sync various frequently used folders between different PC’s by creating a truecrypt volume and transferring only a single file so that you never missing anything while syncing and the copy can be done whole lot quicker.
But it will be a tedious and boring task to repeatedly follow a sequence of steps to get your volume mounted. But we can find out a simple solution for this…
So every time we have to mount a drive, we have to
- Open Truecrypt
- Select the drive where the file needs to be mounted.
- Browse the encrypted file
- Enter the long and strong password, mount the volume
Similar steps are needed while dismounting the drive as well.
Thanks to command line support of Truecrypt which is utilized here to mount the drive with few strokes.
Mount from commandline
We use the following command to mount from commandline
_TruecryptExePath_ /q background /v _EncFile_ /lx /p _Pswd_ + /b
/q – Automatically perform requested actions and exit, launches the TrueCrypt Background Task (tray icon).
/v – File and path name of a TrueCrypt volume to mount (Enclosed in quotes)
/l – Driver letter to mount the volume as.
/p – The volume password (Enclosed in quotes)
_TruecryptExePath_ = Path of truecrypt exe e.g “D:\Truecrypt\Truecrypt.exe” (Enclosed in quotes)
_EncFile_ = Path of Encrypted file e.g “D:\MyStore.enc”(Enclosed in quotes)
_Pswd_ = Volume password e.g “demo123” (Enclosed in quotes)
Dismount from commandline
_TruecryptExePath_ /q /dy
Mount from Launchy
Any application launchers like Launchy can be used to run a particular program by using shortcuts.
- Go to Plugins tab from Launchy Options
- Select Runner Plugin
- Give suitable shortcut name in Name, _TruecryptExePath_ in Program and the command mentioned above in Arguments.
Launchy Runner Config
So next time to mount a volume just do Alt+Space (default Launchy hotkey) and type shortcut name.
I’ve put shortcut as ‘cryptX’ which will mount my enc file to X: drive. So all I’ve to do is type ‘crx’ and press Enter (Launchy matches ‘crx’ and finds ‘cryptX’ automatically)
Repeat this and use the command for dismount and assign it to Launchy. I’ve used ‘dcryptX’ to dismount from X: (So I type ‘dcrx’ in Launchy)
Note: If you want to mount secure truecrypt volume in command line, encrypt password using MD5 tool onto a textfile and use the same to decrypt and compare with the password you input in CLI. This method is considered to be insecure so its recommended not to use.
Update: Use the following command to enter the password onto launchy or display the actual ‘Enter Password’ screen of Truecrypt. This means you are still secure with using Launchy for Truecrypt.
_TruecryptExePath_ /q background /v _EncFile_ /lx /p $$ + /b
- To display the truecrypt ‘Enter Password’, type ‘cryptx’ and press enter
- To mount the volume silently without prompting the password, type ‘cryptX’ + Tab Key +