IVR Tutorial Lesson 4: Run Windows Batch File
In order to avoid making outbound calls while the incoming call is still active, we need to delay the launch of the BroadcastByPhone program. Here, we'll use a Windows batch file to accomplish this task.
Windows batch files, also called batch programs or scripts, can simplify routine or repetitive tasks. A batch file is an unformatted text file that contains one or more commands and has a .bat or .cmd file name extension. When you type the file name at the command prompt, cmd.exe runs the commands sequentially as they appear in the file. For more information, please search the topic online or Microsoft's website.
Prepare the Batch File
The following batch file launches BroadcastByPhone program after a 30 second delay. Use the Windows Notepad program to enter the following lines, and then save it as
under the folder .REM delays for 30 seconds
REM uses ping command as a workaround because there is no sleep command
REM now launches BroadcastByPhone
REM adds
if you want to keep the program up after broadcastThe line REM starts with is comments. The %1 refers to the first argument when the batch file is invoked.
Run the Batch File
You can run the batch file from windows command window, or select the Windows Start button, select
, then type in the following commands:
This batch file will first wait for 30 seconds and then launch the BroadcastByPhone program. The sample message is used for the broadcast. In the IVR sample, we'll pass the recorded audio file as the batch file argument.