Letters by Existence of a File

USBDLM

 

Letter by Existence of a File or a Folder


 

[DriveLetters]

FileExists=%Drive%\drive_a.id

Letter1=A

 

This sample works for USB drives only because of the default value BusType=USB.

 

To make it work with other types too, just configure them as additional BusTypes:

 

[DriveLetters]

BusType=USB

BusType=FireWire

BusType=SCSI

FileExists=%Drive%\drive_a.id

Letter1=A

 

 

Since V4.2 wildcards can be used. The evaluation is done by Windows, therefore it's different form the USBDLM internal wildcards.

Only the given folder is scanned, no sub-folders!

 

Sample to start the "ImageViewer" if a JPG file or the folder "DCIM" (as created by all digicams) is found and the "VideoPlayer" for AVI and MPG:

 

[OnArrival]

FileExists=%Drive%\*.jpg

FileExists=%Drive%\DCIM

open="%ProgramFiles%\ImageViewer\ImageViewer.exe" %Root%

 

[OnArrival]

FileExists=%Drive%\*.avi

FileExists=%Drive%\*.mpg

FileExists=%Drive%\*.mpeg

FileExists=%Drive%\*.mkv

FileExists=%Drive%\*.mov

open="%ProgramFiles%\VideoPlayer\VideoPlayer.exe" %Root%

 

[OnArrival]

DirExists=%Drive%\VIDEO_TS

open="%ProgramFiles%\DvdPlayer\DvdPlayer.exe" %Root%

 

 

 

Since V4.3 USBDLM can test for absence of a file or folder (FileNotExists).

Sample to mount a TrueCrypt volume on X: if X: is available:

 

[OnArrival]

DeviceType=TrueCrypt

FileNotExists=X:\

open="%ProgramFiles%\TrueCrypt\TrueCrypt.exe" /v %PartitionName% /lX /q

 

 

Since V4.3 the presence of a folder can be checked explicit using DirExists and DirNotExists.

 

[OnArrival]

DeviceType=TrueCrypt

DirNotExists=X:\

open="%ProgramFiles%\TrueCrypt\TrueCrypt.exe" /v %PartitionName% /lX /q

 

 

Using any of these may cause slower arrivals because the file system must be mounted to check for a file or a folder.

 

 

Since V4.6.9.2 the maximum waiting time can be configured in Milliseconds. Default is 6.5 seconds for CD/DVD drives and two seconds for all other types. Sample for five seconds:

 

[DriveLetters]

FileTimeout=5000

FileExists=%Drive%\drive_a.id

Letter1=A

 

FileTimeout is used for all file criteria in the section.