Guide: Extend Langmeier Backup with VBScript
Langmeier Backup provides the ability to create scripts to implement advanced backup concepts. Experienced administrators thus have the opportunity to incorporate very specific data backup requirements into the backup run.
The script editor is located under the Tools > Edit Scripts menu:
Click on the "Script" selection box and select the empty entry there to create a new script. Using Save As... you can save this script.
You can use all VBScript commands in the script. In addition, you can use the following scripting commands implemented specifically for Langmeier Backup to automate
The complete command index can be found in Langmeier Backup's online help, which can be accessed from within the program. Here is an excerpt of frequently requested functions.
Assigns a value between 1 and 100 to the Progress variable, sets the value of the progress bar in the data backup window.
Puts out a text to the user in the Langmeier Backup s message window. This text is additionally stored in the backup log.
italic = optional parameters
Using the „Backup“ function, a folder, or file can be backed up.
italic = optional parameters
Example 1: A normal backup where the source and destination are specified.
Example 2: An encrypted backup: here the source and destination are specified, plus set to encrypt the data.
Example 3: Encrypted backup with complete path: Here, as in Example 2, an encrypted backup is performed and, in addition, the complete path is backed up.
'Encrypted backup with complete path:
Breaks the backup, but not the current script.
Returns the name of the inserted media.
If GetMediaName ("\\.tape0") <>
SendSMS (Text as String, Number as String) (function)
An option that many of our customers use is the “SendSMS” option. This option sends the customer an SMS to a mobile phone at the end of a backup. If the recipient is not in Switzerland, then the international dialing code must be provided.
'Sends a text message to the backup administrator:
'Sends a short message to the backup administrator -
Indicates how many files were backed up. This value appears in the feedback to the user after the backup operation. In addition, this value is also specified in the backup log.
Returns or overwrites the destination folder preset in the script's save element.
Returns or overwrites the source preset in the script's save element. If the script name (for example, @SendSMS) is under the source, then the script name is returned.
After you have written/created a script, save it. The „Save“ and „Save As“ options can be found below the script editor.
Click on "Save As" you can give your script a name:
The scripts will be stored in the following folder:
Any scripts you have saved can be added to the backup job in the main Langmeier Backup window under "Backup" - "Add"
After you have selected your script, the script name will appear with a prefix „@“ in the backup job, here "@SMS". The script will be executed as soon as you click on "Backup" - "Start" in the backup run.
By double-clicking on the inserted script, here "@SMS", you can define the destination path (which you can retrieve in the script using "Destination"):
Order: Pay attention to the order in the backup job! If a script is to be executed at the end of a backup, then the script must also be inserted at the end. Langmeier Backup processes the scripts in the order they are in the backup job. If the script is a function that should be called at the beginning or after a specific folder path, then the script must be inserted in the correct line accordingly.
You can also add a VBScript you created yourself to a job in a different way. Go to „Options“ and there to „Settings for this job“. You will find options to run „Before Backup“ and options to run „After Backup“. Add your VBScript to the desired location. Note that with this method, Langmeier Backup's own functions such as SendSMS or Backup described above are not available. However, you can use this method to call any batch scripts or any compiled exe files.
The specifications in this article are available in the following products:
About the Author Urs Langmeier, Founder and CEO of Langmeier Software GmbH
Articles relevant to the topicLangmeier Backup Version 10 is here
FAT32 or NTFS? Which format is better for backup?
How to back up your hard drive properly and not forget anything