Wednesday, September 21, 2011

USB drive daily usage: encrypt & sync

As I described in a previous post, I advise the Rohos Mini Drive to be used on a USB Stick for daily usage. It does everything you can expect from an encryption tool, but has the benefit to have a unique non-admin account support with Rohos Disk Browser. But for a user friendly daily usage of a USB drive, an automated synchronization process is required on top of a safe encryption mechanism: you always want the latest version of your files to be available on your own pc and USB stick. If you change anything on any location, all files should get updated immediately.

For this I combine the strength of Rohos Mini Drive with GoodSync. GoodSync can be configured to monitor if a USB stick is attached to your system. If it detects the encrypted disk, it needs to launch the Rohos Mini Drive to give access to the encrypted files. Once the encrypted files are accessible by your PC, the files should be synchronized automatically. Since Rohos Mini Drive provides access to the files as a new virtual disk, GoodSynch can be configured to be launched as soon as this virtual disk becomes available. And at that moment, the full synchronization features of GoodSync can be started to make sure all latest versions of your files are available on your PC and on your USB stick.

So the only missing part in this process, was the need to launch Rohos Mini Drive and mount the virtual disk automatically. I solved this using the little batch script below. It will find the correct drive, launch Rohos Mini Drive to mount the encrypted disk. The user will need to provide the password. Once the correct password is provided, the encrypted drive will be mounted (become available in Windows Explorer).

GoodSync is configured to launch the batch script as soon as the USB stick is connected. The batch script will mount the encrypted disk and another GoodSync job will detect this virtual encrypted disk to become available. In this GoodSync job, the synchronisation of the local folder and encrypted USB Stick folder is configured.

Some screenshots of the different configurations:

@echo off
set PROCESS_NAME=Rohos Mini.exe
tasklist /FI "IMAGENAME eq %PROCESS_NAME%" 2>NUL | find /I /N "%PROCESS_NAME%">NUL


set _Target=NotFound

for /f usebackq %%a in (`Drives.exe -f %USB_STICK_NAME%`) do set _Target=%%a
if "%_Target%" == "NotFound" (
echo Unable to find target drive named "%USB_STICK_NAME%"
goto :EOF
start "Rohos" "%_Target%\%PROCESS_NAME%"

Update 06/11/2012: I moved to using EncFS to encrypt my files on Windows/Cloud/Android instead of using Rohos Mini Drive. Rohos had some compatibility issues with Windows 7. This good blogpost describes all tools needed to get started with EncFS on different environments. I’m only missing a decent portable solution that could work without admin rights.

Monday, August 22, 2011

Batch parameter modifier

In batch script, one can use the following modifier to expand to full path etc.

%1 first parameter provided to the script.
%~1 Expands %1 and removes any surrounding quotation marks ("").
%~f1 Expands %1 to a fully qualified path name.
%~d1 Expands %1 to a drive letter.
%~p1 Expands %1 to a path.
%~n1 Expands %1 to a file name.
%~x1 Expands %1 to a file extension.
%~s1 Expanded path contains short names only.
%~a1 Expands %1 to file attributes.
%~t1 Expands %1 to date and time of file.
%~z1 Expands %1 to size of file.
%~$PATH:1 Searches the directories listed in the PATH environment variable and expands %1 to the fully qualified name of the first one found. If the environment variable name is not defined or the file is not found, this modifier expands to the empty string.
%~dp1 Expands %1 to a drive letter and path.
%~nx1 Expands %1 to a file name and extension.
%~dp$PATH:1 Searches the directories listed in the PATH environment variable for %1 and expands to the drive letter and path of the first one found.
%~ftza1 Expands %1 to a dir-like output line.
%cd% current working direcotry.
%~dp0 script directory.
%~dp0..\ parent of script direcotry.

SET Today=%Date: =0%
SET TodayYYYYMMDD=%Today:~-4%%Date:~-7,2%%Date:~-10,2%
SET Now=%Time: =0%

In the previous examples, you can replace %1 and PATH with other batch parameter values.

The %* modifier is a unique modifier that represents all arguments passed in a batch file. You cannot use this modifier in combination with the %~ modifier. The %~ syntax must be terminated by a valid argument value.

You cannot manipulate batch parameters in the same manner that you can manipulate environment variables. You cannot search and replace values or examine substrings. However, you can assign the parameter to an environment variable, and then manipulate the environment variable.

Friday, January 21, 2011

Salling Clicker - Windows Mobile

Salling Clicker is a remote control software. It lets you control popular applications from a mobile phone or handheld computer through a user interface similar to a portable media player.
You can choose to have the computer take action when you make or receive a phone call or get close to your pc. For instance, Salling Clicker can automatically mute the system volume while you're on the phone or automatically lock the pc while your gone.

  • Control PowerPoint, iTunes, Windows Media Player, and more with your mobile device.
  • Works with all major Bluetooth stacks (no configuration required).
  • Amazingly easy-to-use WiFi connectivity for long-range control.
  • Works with over 300 devices.
  • Easily extend support for other applications using JavaScript or VBScript


Salling Clicker is installed with a set of default scripts (JavaScript for Windows) to support many different applications (PowerPoint, iTunes, MediaPlayer, etc.). On the forums of Salling Clicker many other custom scripts can be found, created and shared by the community.
I've created a set of personal scripts, some are base on the official scripts, some are based on the scripts found in the forums and some are completely new. I just list all the scripts I use:
  • De Slimste Mens: as explain in this separate blog post, I've created a complete interface to control the Flemish game "De Slimste Mens".
  • myT Mouse Keyboard: full control for mouse and keyboard. Specially made for Windows Mobile devices with hardware keyboard (tested on Samsung Omnia B7310 and HTC Wizard (Qtek9100)). Use the screen to move mouse, use 'Menu' button to get context menu (mouse right click), use 'Help' button for extra options. To get a good overview of all options, I’ve put some screenshot online.
    Use hardware keyboard to send all keys. The used keys will be displayed on the main screen for easy action tracking.
    The extra option are:
    • switching of Shift/Ctrl/Alt/Win keys
    • sending special characters
    • sending function keys (eg F1-F12, pause, insert, delete, etc)
    • sending media keys (play next song, webbrowser control, etc)
    • sending long text: text input on device
    • open a file on pc: navigate to folder and open a file, recent file history, easy access to favorite locations (eg start menu, 'my documents', etc)
    • Zoom screen using freeware ZoomIt application, all ZoomIt options supported (pen, break, etc)
    • Show a screenshot of the pc on the main screen.
    • Exchange data from pc clipboard to device and/or put text into the pc clipboard
  • PowerPoint: distribuated by Salling Clicker
  • MediaPlayer: distribuated by Salling Clicker
  • MediaPortal: from forum
  • MediaCenter: from forum
  • iTunes: distribuated by Salling Clicker
  • BSPlayer: from forum
  • VLC: from forum
  • WinDVD: from forum
  • MSN Online status: from forum
  • uTorrent: from forum
  • ShutdownControls: shutodown/hibernate/standby/screen on-off/lock
  • Device Info: distiribuated by Salling Clicker
  • Disconnect: distiribuated by Salling Clicker
  • System volume: control pc volume
  • MuteWhileOnPhone: distribuated by Salling Clicker
  • CallNotifier: distribuated by Salling Clicker
  • LockComputer: distribuated by Salling Clicker
  • MonitorAway: distribuated by Salling Clicker
  • Show Message: show message on pc

Monday, January 17, 2011

Toshiba Tecra S11

We recently replaced our old portable Lenovo ThinkPad T61 by the Toshiba Tecra S11, Intel® Core™ i5 M520, 2,40GHz, 4GB Ram.
Although this new one is certainly not the best device available, as can be read in this technical review, it has some nice new features like a finger print reader, SmartCard reader, webcam, DisplayPort and a larger HDD (320GB).


When we received the laptop, not all drivers were installed correctly. Additional drivers can be download and should be installed in the provided order:

Toshiba official software download site:, 64 bit drivers


  • The build-in SmartCard reader can be used to read the Belgian eID cards, and thus also to login on the Tax-On-Web pages. After installation of the SmartCard driver (see above) and a reboot, install the eID software and reboot again.

  • AutoSensitivity allows you to define different mouse sensitivities (speeds) for your touchpad and mouse and automatically switch between them (based on mouse connect / disconnect). This can be useful since the touchpad on this Toshiba is rather slow.

  • Windows Explorer extentions

Update 22/05/2012: As I moved to Windows 64 bit, I added the link to download 64 bit drivers.