Click here to Skip to main content
13,189,884 members (61,056 online)
Click here to Skip to main content
Add your own
alternative version


52 bookmarked
Posted 3 Jun 2007

TCExplorer - Portable Software to Import, Export, Delete, Rename, View, Edit and Execute Files in TrueCrypt Containers

, 9 Oct 2007
Rate this:
Please Sign up or sign in to vote.
A portable software to import, export, delete, rename, view, edit and execute files in TrueCrypt containers without requiring administrative privileges
Screenshot - TCExplorer.gif


TrueCrypt is a free open-source disk encryption software. It is able to create a virtual encrypted disk within a file and mounts it as a real disk. The encryption is automatic, real-time (on-the-fly) and transparent. However, a major disadvantage of TrueCrypt and all other on-the-fly encryption software is the requirement of administrative privileges on the computers where they are used. Thus they will not be usable in places such as public libraries and internet cafes, where the computers are typically locked down and the users are given only limited privileges.

The purpose of this software is to overcome this limitation of TrueCrypt by providing an interface, similar to compression and decompression software, where directories and files can be imported and exported easily from TrueCrypt containers. There are some debates on the merits of such software. Those in favor argue that it will make TrueCrypt truly portable. Those against it argue that it is a security breach to extract files stored in TrueCrypt containers to computers where you do not have control. I do not wish to partake in such debates. This software arises because of my own needs. I wish to transport my documents (which are not very confidential) in my thumbdrive but I do not wish others to be able to look at my documents if I accidentally lose my thumbdrive. Thus I need to encrypt my files and a good candidate to encrypt them is TrueCrypt. However, as I may need to extract the files onto other computers (which most likely will not be logged in as administrator), I will need a software which allows me to extract TrueCrypt files without requiring administrative privileges. A search on the net shows that it is possible to create such software and a proof-of-concept commandline software, OTFExplorer has been created by Josh Harris. However, the author did not wish to continue the project to build a GUI interface. This software picks up where Josh Harris left off.

Main Features

  1. Import directories/files into TrueCrypt containers
  2. Export directories/files from TrueCrypt containers
  3. Delete directories/files stored in TrueCrypt containers
  4. Rename directories/files stored in TrueCrypt containers
  5. View text/HTML/graphic files stored in TrueCrypt containers
  6. Edit files stored in TrueCrypt containers
  7. Execute files stored in TrueCrypt containers
  8. Show total, used and free space in TrueCrypt containers
  9. Color-code files according to their extensions
  10. Rapidly access list of favorite TrueCrypt containers

Main Limitations

The following limitations primarily arise because of the limitation of OTFExplorer.

  1. Cannot handle files with Unicode names in TrueCrypt containers (though able to open TrueCrypt containers with Unicode names)
  2. Can only open TrueCrypt containers with FAT partitions
  3. Cannot handle hidden volumes (may not be a limitation of OTFExplorer)


Opening a TrueCrypt container: Either use File->Open or just drag and drop a TrueCrypt container from Windows Explorer to TCExplorer.

Importing directories/files into TrueCrypt container: Drag and drop directories/files from Windows Explorer to TCExplorer.

Exporting directories/files from TrueCrypt container: Drag and drop directories/files from TCExplorer to Windows Explorer. The directories/files will first be extracted to a predefined temporary directory, and then moved to the destination directory.

Deleting directories/files from TrueCrypt container Select directories/files in TCExplorer and press Del key.

Renaming directories/files from TrueCrypt container: Select a directory or file in TCExplorer and click on it again to activate the change name option.

Opening a TrueCrypt container from commandline: The command "TCExplorer.exe" will launch TCExplorer and load the TrueCrypt container "". TCExplorer will then prompt the user for password before continuing. This feature may be useful if you want to always automatically load a particular TrueCrypt container when you plug in your thumbdrive.

Opening a file in TrueCrypt container for editing or execution: Double click on the files to open. The files will first be extracted to a predefined temporary directory and then either opened using the associated program or if it is an executable file, it will be run. If the opened files were modified, the user will be asked whether he/she wishes to re-import the modified file into the TrueCrypt container.

Viewing a file using the internal viewerRight-click on a file and choose "View with Internal Viewer". The file will be extracted to memory and shown in an internal viewer. This feature is useful if you do not wish to write any files to disk. However, the file may still remain in memory after the internal viewer is closed.


  1. Stay on top: Make TCExplorer stay on top of other windows
  2. View file size: View size of files stored in TrueCrypt containers
  3. Save window position: Save last window position and size on closing and revert on next launch

Points of Interest

TCExplorer is built using wxWidgets. The source codes provide a good learning resource for drag and drop operations. Of particular interest is the development of customized wxIDropSource and wxDropSource classes (TCIDropSource and TCDropSource).

STDMETHODIMP TCIDropSource::QueryContinueDrag(BOOL fEscapePressed,
                                              DWORD grfKeyState)
  if ( fEscapePressed )

  // initialize ourselves with the drag begin button
  if ( m_grfInitKeyState == 0 ) {
    m_grfInitKeyState = grfKeyState & (MK_LBUTTON | MK_RBUTTON | MK_MBUTTON);

  if ( !(grfKeyState & m_grfInitKeyState) ) {
    // button which started d&d released, go!

    m_pDropSource->tcList_->Export(); 	// Export directories and files 
					// to temporary system directory.

    return DRAGDROP_S_DROP;

  return S_OK;

The above shows the modifications to the wxIDropSource class. By adding codes before the return DRAGDROP_S_DROP; statement, TCExplorer is able to delay the extraction of files to the temporary directory until the user releases the mouse button. However, I do not know how to check whether the window where the user drops the files is able to receive the files or not. So even if the window is not able to receive the files, the files will still be extracted to the temporary directory.

TCDropSource::TCDropSource(TCList *tcl,
                           const wxCursor &cursorCopy,
                           const wxCursor &cursorMove,
                           const wxCursor &cursorStop)
            : wxDropSourceBase(cursorCopy, cursorMove, cursorStop), tcList_(tcl)

TCDropSource::TCDropSource(wxDataObject& data,
                           TCList *tcl,
                           const wxCursor &cursorCopy,
                           const wxCursor &cursorMove,
                           const wxCursor &cursorStop)
            : wxDropSourceBase(cursorCopy, cursorMove, cursorStop), tcList_(tcl)

The above shows the main modification to the wxDropSource class. The two constructors are changed so that they will receive a pointer to the class which handles the export function.

A side effect of using the wxIDropSource and wxDropSource classes is that TCExplorer can only be compiled for the Windows platform, even though it is using wxWidgets.

In addition to the drag and drop operations, the source codes also provide numerous examples of directory operations in wxWidgets. The source codes are fairly well commented and the reader is invited to look at them to understand more of the inner workings of TCExplorer.

Compiling the Source Code

A Code::Blocks configuration file is provided. You will need to download and install wxWidgets before you can compile TCExplorer. For more details on the required location of the wxWidgets libraries, please refer to the Code::Blocks configuration file.

Known Bugs

  • Bug 1: The list control window in TCExplorer may not refresh correctly after renaming a directory/file. Workaround: Press F5 to refresh the list control. (If there are any wxWidgets experts who know how to solve this, please contact me.)
  • Bug 2: TCExplorer may crash when importing/exporting/deleting/renaming a file with apostrophe. I was able to duplicate the crash a few times before it disappears again.


TCExplorer is released as public domain. This means that the source code is provided without any restrictions. The licence for OTFExplorer is included in the source code package.

Future Plans

None. TCExplorer has currently met all my personal needs so I will not be adding any new features in the near future (though from my updates since version 1.1, you can see that I do add new features if I find that they are easy to add). Since the source code is public domain, you are free to modify it to suit your needs. However, I would appreciate it if you could either send me any important modifications so that I can incorporate it into TCExplorer, or release the modifications yourself so that everyone can benefit from it.


  • 29 September 2007: Version 1.6 released
    • Bugfix: Corrected bug that occurs during drag and drop TrueCrypt container file after previous opening error.
    • Enhancement: Added "Delete temp dir now" under File menu to delete the temporary directory immediately.
    • Enhancement: Added "Restore Defaults" button to Temporary Directory options.
    • Enhancement: Allow user to specify colours for displaying files based on their extensions.
    • Enhancement: Allow user to view contents of text files without extracting the files from the TrueCrypt container.
  • 17 September 2007: Version 1.5.1 released
    • Bugfix: Resolve "DDE execute request failed" error.
  • 4 September 2007: Version 1.5 released.
    • Bugfix: Corrected over-aggressive check for full TrueCrypt container on import.
    • Enhancement: Added message dialog for confirmation of overwriting existing files in container during import.
    • Enhancement: Allow user to define any directory as the temporary directory.
    • Enhancement: Added option to securely delete directories/files in temporary directory using Eraser commandline (eraserd.exe).
    • Enhancement: Added Favorites menu to allow user to maintain a list of TrueCrypt containers for easy access.
    • Enhancement: Allow TCExplorer to open a file in TrueCrypt container using the associated program and re-import the file if changes are done.
  • 11 June 2007: Version 1.4 released.
    • Enhancement: TCExplorer now has an icon!
    • Enhancement: Allow TCExplorer to open a file from the commandline. e.g. "TCExplorer.exe".
    • Enhancement: Added option to allow TCExplorer to save last window position and size on closing and revert on next launch.
    • Enhancement: Added option to allow TCExplorer to not delete directories/files in temporary directory after exporting is finished so that users can use their own file shredder software to securely delete the temporary directories/files.
    • Enhancement: Added option to securely delete directories/files in temporary directory after exporting is finished by overwriting the files with null characters and then renaming them to ~ before deleting them. Directories are also renamed to ~ before deletion.
  • 8 June 2007: Version 1.3 released
    • Bugfix: Prevent directories/files in TrueCrypt container from dragging and dropping onto the same TrueCrypt container. The previous bugfix didn't really solve the problem.
    • Bugfix: Remove error message when no renaming is done.
    • Enhancement: Added option to view size of files stored in TrueCrypt containers.
  • 7 June 2007: Version 1.2 released. Thanks to dcrochet from TrueCrypt forum for pointing out the following bugs.
    • Bugfix: Prevent files from being imported if TrueCrypt container becomes full.
    • Bugfix: Prevent directories/files in TrueCrypt container from dragging and dropping onto the same TrueCrypt container.
    • Enhancement: TCExplorer is now compressed with UPX, thanks to BuddhaChu from PortableApps for the suggestion.
  • 3 June 2007: Version 1.1 released
    • Renamed software to TCExplorer because TrueCrypt is a registered trademark and cannot be used
  • 2 June 2007: Version 1.0 released


The author does not guarantee that the software will work perfectly. Please use this software only on data that you can afford to lose. By downloading and using this software, you have implicitly agreed to be part of the guinea pig experiment to test the software for any bugs.


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Yap Chun Wei
Singapore Singapore
No Biography provided

You may also be interested in...

Comments and Discussions

GeneralProblem in opening in vs 2005 Pin
bhaskar jatav18-Dec-07 22:20
memberbhaskar jatav18-Dec-07 22:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.171016.2 | Last Updated 9 Oct 2007
Article Copyright 2007 by Yap Chun Wei
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid