Lock and Load is an application that allows you to listen to various windows events, and execute an arbitrary number of commands (or scripts) as a response.
Lock and Load is written using C# and requires the .NET 3.5 framework.
Upon execution Lock and Load immediately goes to the Notification Area (aka System Tray) where it remains waiting to respond to any configured events.
The latest version can be found here Lock and Load - Version 1.2.1
Upon first execution an empty configuration item will be placed in your Application Folder (this depends upon the version of windows being used), in a sub folder named “notunusual\LockAndLoad”.
Beginning with version 1.2.1 you can now override the location of the configuration file
Command Line Arguments
|-c||path_to_executeable||The full path to the configuration file to load|
The configuration looks like the following –
<ConfigurationManager xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <ExecuteItemsArray> <Executable FileName="C:\Path\To\My\App.exe" Arguments="" Trigger="SessionLock" UseShellExecute="false" WaitToFinish="false" CreateWindow="false" /> </ExecuteItemsArray> <InteractiveMode>true</InteractiveMode> </ConfigurationManager>
The InteractiveMode tag is a Boolean value (true/false) if true a notification icon will be created to interact with Lock and Load. This value defaults to true.
You can provide any number of Executable elements that re-act to any of the trigger events.
|FileName||String – The full path to the application to execute|
|Arguments||String – Any arguments to pass to the executable, this can contain any of the special paramaters|
|UseShellExecute||Can be true or false – Indicates whether to use the operating system shell to start the process.|
|WaitToFinish||Can be true or false – Should Lock and Load wait until the executable is finished before moving on to the next executable?|
|CreateWindow||Can be true or false – Indicates whether to start the process in a new window|
|Trigger||See Triggerable Events Table|
Triggerable Events Table
|ConsoleConnect||A session has been connected from the console.|
|ConsoleDisconnect||A session has been disconnected from the console.|
|RemoteConnect||A session has been connected from a remote connection.|
|RemoteDisconnect||A session has been disconnected from a remote connection.|
|SessionLogon||A user has logged on to a session.|
|SessionLogoff||A user has logged off from a session.|
|SessionLock||A session has been locked.|
|SessionUnlock||A session has been unlocked.|
|SessionRemoteControl||A session has changed its status to or from remote controlled mode.|
Special Parameters Table
|%trigger%||This is replaced with the trigger name which initiatied this event, the values passed match the Trigger names|
|%user%||This is replaced with the currently active windows user|
|%date%||This is replaced with the current date and time with “Short Date/Long Time”, equivalent to passing ‘G’ as the date time format specifier|
|%date-X%||This is replaced with the current date and time in a format specifed with X. The possible values for X are described in the MSDN Standard Date and Time Format Strings page.|