Have a Question?
Table of Contents
< All Topics

Timed Shutdown of LIMS Messaging


The information in this article applies to LIMS Messaging 3.0 or newer.

LIMS Messaging (Messaging) maintains a connection to the production LimsData database while it is active. Not all backup software can successfully back up files that are open and in use. If you need to close Messaging to ensure proper back up of the LimsData database, this article shows you how to use a VB script to shut down LIMS Messaging.

More Information

LIMS Messaging is used to automatically send final reports with sample results in real time via email or fax when either a single sample or a batch of samples is completed in the LIMS. Messaging is an optional installation component of LIMS and is designed to run unattended on a separate workstation, virtual PC, or server. To perform its tasks, Messaging maintains a connection to its LimsMsgs message queue database as well as the production LimsData database.

If your LimsData database is located on a file server and your server performs automatic overnight backups, for example, you may need to shut down Messaging at a specific time each day to release its open connection to the database file. Although Messaging does not include a timed shutdown feature, a simple VBScript (Visual Basic Scripting Edition) script can be used.

MSC-LIMS Messaging

In Messaging’s main screen above, clicking the [Exit] button or using Alt+X, the button’s access key, will initiate a shutdown and display the confirmation dialog below. Since the highlighted [OK] button is the confirmation’s default button, using the Enter key will select the button and close Messaging. We can close Messaging with two keystrokes: Alt+X followed by Enter. A simple VBScript can be used to send these two keystrokes.

Exit MSC-LIMS Messaging

Below is the text for a VBScript that will shutdown Messaging. You can download a copy of the script in file ShutdownMessaging.vbs in the File Library.

' Shutdown LIMS Messaging by sending Alt+X then [Enter]
Set objShell = WScript.CreateObject("WScript.Shell")
Do Until Success = True
    Success = objShell.AppActivate("LIMS Messaging")
    Wscript.Sleep 1000
objShell.SendKeys "%X"
objShell.SendKeys "{ENTER}"

This VBScript uses the Windows Scripting Host (WSH) WScript object to activate the running instance of Messaging by giving its window the focus. Once Messaging’s window has the focus, the script simply sends an Alt+X followed by an Enter keystroke.

To automatically shut down Messaging at a specified time each day, simply add a new task in the Windows Task Scheduler to run the script using either program Wscript.exe or Cscript.exe. For example, the following command added to the Task Scheduler will shut down Messaging:

C:\Windows\System32\Wscript.exe "C:\LIMS\ShutdownMessaging.vbs"

See Task Scheduler’s help for more information.

Table of Contents