Commands

On the Commands tab you can configure the execution of command lines (see illustration with example command).

  • A drive was connected and locked by DriveLock.

  • A drive was connected and not locked by DriveLock

  • A drive was disconnected

The command line can contain any command executable from the command line. Thus, for example, you can run a program (*.exe), a Visual Basic script (*.vbs) or scripts for the new Windows PowerShell.

In this way it is possible to react to these events in many different ways. For example, you can start a backup process when a certain external hard disk is plugged in. Or, for example, you can use a PowerShell script to copy images from a camera to a predefined network share completely automatically.

To run a VB script, you must specify the full path to the script file (e.g. cscript c:\programing\scripts\meinscript.vbs).

There are some variables that can be used within the command line and are replaced by the agent with the current values before execution:

%LTR% Assigned drive letter
%NAME% Drive name
%SIZE% Drive size
%USER% Name of the user currently logged in
%SERNO% Drive serial number
%HWID% Hardware ID of the device
%PRODUCT% Drive product ID
%VENDOR% Drive manufacturer
%FILESTG% Path to a file within the policy file store

To do this, click < and select one of these variables so that it is inserted at the current cursor position.

Click the ... button to insert a file name at the current cursor position. You can choose between two options:

  • File system: the file exists on the computer's local hard drive

  • Policy file store: Use the file from DriveLock's policy file store

The policy file store is a file container that is stored as part of a local policy, group policy, or configuration file. It can contain any files (such as scripts or applications) that are automatically distributed with a DriveLock configuration.

A file loaded from the policy file store is indicated by a "*". If you use a file from the policy file store, you must also use the variable %FILESTG% as the relative path.

In addition, you can specify whether the new process should run with the same permission that the agent has or whether it should run in the user context (i.e. under the identifier of the currently logged-in user).