Langmeier Backup FAQ
Guide: Extend Langmeier Backup with VBScript
Contents of this page:
Command Index Save Script Add Script to the Backup Task Alternative Scripting Options Langmeier Backup empowers you to create custom scripts, enabling advanced data backup strategies tailored to your specific requirements. This feature is especially valuable for experienced administrators who wish to implement unique workflows or automation within their data backup processes. Examples of what you can achieve with scripting:
The Script Editor can be accessed via the menu: Tools > Edit Scripts:
To create a new script, click on the “Script” selection field and choose the empty entry. Use “Save as...” to store your script. You may use all VBScript commands within your script. Additionally, Langmeier Backup provides special scripting commands (detailed below) to automate Langmeier Backup even further. Command IndexThe complete command index is available in the Langmeier Backup online help, accessible directly from the program. Below, you will find a selection of the most frequently used functions. Progress (variable)
Assigning a value between 1 and 100 to the Examples:
Progress = 0 ' Progress bar at 0 – nothing backed up yet
Message (method)Outputs a message to the user in the Langmeier Backup message window. This message is also saved in the backup log. Parameters:
Italic = Optional parameters Example 1: Message "Script completed."
Example 2:
Message "Please write the data carrier with 'Backup " & Weekdayname(Weekday(now)) & "' to.", 1
Backup (method)The Backup function allows you to back up a folder or file. Parameters:
Italic = Optional parameters Example 1: A standard backup specifying source and destination.
' Normal backup:
Backup "C:\Source", "D:\Destination" Example 2: An encrypted backup:
' Encrypted backup:
Example 3: Encrypted backup with complete path:
' Encrypted backup with complete path:
Backup "C:\Source", "D:\Destination", , True, , , True Break (method)The Break method interrupts the backup process, but does not terminate the current script. Parameters:
GetMediaName (function)Returns the name of the inserted medium. Parameters:
Example:
If GetMediaName("\\.\tape0") <>
"Monday" ThenMessage "Please insert the tape `Monday`!", 3 ' 3 = Stop symbol EjectMedia Break End If SendSMS (Text as String, Number as String) (function)Many of our customers use the SendSMS function to send an SMS notification to a mobile phone at the end of a backup. If the recipient is outside Switzerland, please include the international area code.
Parameters:
Example:
' Sends a text message to the backup administrator:
SendSMS "Backup completed.", "004179512xxxx"
' Sends a text message to the backup administrator –
' the message contains the value specified under "Target", ' the number of errors, and the number of successfully backed up files: SendSMS Term("The backup to is complete. Error: Backed up: ", Destination, Errors, Counter), "0049xxxxxxxxxxxx" Counter (variable)Indicates how many files were backed up. This value is shown to the user after the backup process and is also recorded in the backup log. Example:
' Starts the command line script "databackup.cmd" from SAP to back up the
CountOfFiles = Shell("%appdata%\SAP\databackup.cmd /dest=" & Destination, 0)
' The counter of the backed up files is now increased by the
Counter = Counter + lCountOfFiles
Destination (variable)Returns or overwrites the destination folder set in the backup element of the script.
Example:
' Backs up the installation folder "SAP R3" to the backup folder set in the script:
Source (variable)
Returns or overwrites the source set in the backup element of the script. If the script name (e.g.,
Example: Source = "C:\"
Save ScriptAfter you have written your script, save it. The options Save and Save as are located below the script editor. ![]() Click on “Save as” to assign a name to your script: ![]() Scripts are saved in the following folder:
Add Script to the Backup TaskYou can add any saved script to a backup task in the main window of Langmeier Backup under “Backup” – “Add”: ![]() ![]() Once you have selected your script, its name will appear in the backup task, prefixed with “@” (e.g., @SMS). The script will be executed during the backup run as soon as you click “Backup” – “Start”. ![]() By double-clicking the inserted script (e.g., @SMS), you can define the destination path, which you can reference in your script using the Destination variable: ![]()
Sequence: Please pay attention to the order of scripts in the backup job! If a script should run at the end of a backup, it must be placed at the end. Langmeier Backup processes scripts in the order they appear in the backup job. If a script is to be executed at the beginning or after a specific folder, insert it accordingly.
Alternative Scripting OptionsYou can also add a custom VBScript to a job in another way. Go to “Options” and then “Settings for this job”. Here, you will find options to execute scripts “Before backup” and “After backup”. Add your VBScript at the desired point. Please note: Langmeier Backup-specific functions such as SendSMS or Backup are not available with this method. However, you can use this approach to call any batch scripts or compiled .exe files. ![]() The information in this article applies to the following products:
Langmeier Backup Backup for WindowsLook it up further: Langmeier Backup, VB-Script, Backup Related articlesWhich type of backup is the best choice for my data?This is how important data backup is in real life The advantages and disadvantages of the different Windows file systems This article covers the topics:VBScriptBackup software with VBScript VBS data backup Langmeier Backup Script |
|||||||||||||||||||||||||||||||||||||