[Home] [Overview] [Developer] [Manual]

Shortcuts of Using TrueCrypt

It is assumed you have:

If you have knowledge above, please read on.

General steps of setting up TrueCrypt on an external drive:

  1. Build an encrypted container on your computer's hard disk.
  2. Copy (green) programs and data to the container after mounting the container file to a local drive letter.
  3. Dismount the container file, and copy the file to the external drive.
  4. Copy TrueCrypt files (TrueCrypt.exe, truecrypt.sys, truecrypt-x64.sys) to the external.

For example, file "mybook" in the screenshot is a encrypted container file.

General steps of using TrueCrypt on an external drive:

  1. After the host machine assign a drive letter to the external drive, go to that drive and run TrueCrypt.exe on the external drive, assuming the host machine has no copy of TrueCrypt.
  2. In the windows of TrueCrypt, locate the container file and mount it to an available drive of the host machines after inputting the password required.
  3. Got to the drive mounted for the container file, and access programs and data there.

Creating shortcuts for TrueCrypt and Open Contacts

If you think these steps are still to much and you want only one program (for example, Open Contacts), you can refer to BAT file example illustrate below and the command line section of the help of TrueCrypt..

TrueCrypt.exe /v mybook /l s /q
start /Ds:\OC /B /WAIT s:\OC\OpenContacts.exe
TrueCrypt.exe /d s /q

The first line will run TrueCrypt and ask TrueCript to mount file "mybook" to drive letter "s". TrueCrypt.exe will prompt you with a dialog box to input password. The second line will launch "s:\OC\OpenContacts.exe", started in folder "s:\OC".  The third line will dismount the drive letter "s" after OpenContacts.exe had finished running. So basically you just need to double click on the BAT file, answer the password of the encrypted container file, then Open Contacts is launched.

Of course the BAT scripts work only for this condition: the host machine always has drive letter "s" available.

1. Start Open Contacts to a specific drive letter

When you work on a computer with many drives allocated  and it is not certain which drive letters are available,  you may try a pair of BAT file and VBS file described below.


TrueCrypt.exe /v mybook /l %1 /q
start /D%1:\OC /B /WAIT %1:\OC\OpenContacts.exe
TrueCrypt.exe /d %1 /q


Dim driveLetter

driveLetter = InputBox("Define which drive letter to mount")

if driveLetter <> "" then

Set WshShell = WScript.CreateObject("WScript.Shell")

WshShell.Run "StartMyBookWithDrive.bat "& driveLetter, 0, true

end if

You are going to double-click on the VBS file which will launch "StartMyBookWithDrive.bat". After answering which drive letter to mount and what password of "mybook", Open Contacts is launched.

It should not be difficult for you to modify above scripts to start other program and data in the encrypted container.

2. Open the encrypted container in a folder window with specific drive letter

In the case when you have multiple programs ready to run in the container, it might be more practical to mount the container file then show up the container in Windows Explorer, so you can access these programs accordingly. Please refer to following scripts.


Dim driveLetter

driveLetter = InputBox("Define which drive letter to mount")

if driveLetter <> "" then

Set WshShell = WScript.CreateObject("WScript.Shell")

WshShell.Run "TrueCrypt.exe /v mybook /e /q /l "& driveLetter

end if

After you double-click on the VBS file, container file "mybook" will be mounted to a drive letter you defined. After answering the password required, a folder window will show up to show all programs and data in the root of the container.

3. Open the encrypted container in a folder window with auto drive letter

If what drive letter does not concern you, you may just run either of the following scripts:


Set WshShell = WScript.CreateObject("WScript.Shell")

WshShell.Run "TrueCrypt.exe /v mybook /e /q /a"


TrueCrypt.exe /v mybook /e /q /a

It is likely you will install various programs into different folder of the root of the encrypted container. It will be handy to have shortcuts under the roots to these programs in sub-folders, so you don't have to navigate to folders to launch programs. Windows' shortcuts (*.LNK file) do not allow relative paths to files, so we can not use LNK files to point to program files in the container since the drive letter assigned to the container may change next time. We can use a BAT file for each of the programs we want to launch from the root of the container. For example, assuming Open Contacts is installed under folder "OC", we can have a BAT file saved under the root like this.

cd OC
start /b OpenContacts.exe

With similar approach, you may create a set of BAT files to launch programs in the container and save them under the root. After you mount the container file and open the newly assigned drive, you will see the list of BAT files, and launch programs accordingly. Just remind you, this BAT file is saved inside the encrypted container, not outside.

You may download the zip file containing 3 groups of script files above, and modify them to suit your needs. Hopefully this article gives you some hints of building shortcuts of using TrueCrypt and programs in encrypted container.

For further questions of how to use BAT, VBS and TrueCrypt, please direct your calls to respective newsgroups, websites, and manuals.