AutoRun for Disk Devices
In analogy to the AutoRun function for storage volumes, USBDLM can execute a command-line on arrival and removal of a disk device, which is handy if the disk has not partitions, e.g. if it is entirely used as a TrueCrypt container.
As criteria all disk specific ones can be used, as the disk's device ID, MinDriveSize, MaxDriveSize, PortName.
All non-drive-specific criteria are available here too. These are Files, User, computer name, running process, operating system and time.
Sample for mounting a TrueCrypt container:
;mount it on J:
[OnDiskArrival]
DeviceType=TrueCrypt
open="%ProgramFiles%\TrueCrypt\TrueCrypt.exe" /q /v \Device\Harddisk%DeviceNumber%\Partition0 /letter J
;dismount J: on safe removal of the disk
[OnDiskRemovalRequest]
DeviceTypes=TrueCrypt,ReadSharingViolation
open="%ProgramFiles%\TrueCrypt\TrueCrypt.exe" /q /dJ
The other parameters known from [OnArrival], as openstyle, system etc work here too.