If we put a wscript.echo "hi" command into a Task for VBScript, it doesn't pop up a message box.
No error is generated. It simply doesn't run.
This is actually working as designed. When we execute VBScripts from the Altiris Agent, we launch a command window and launch the script via CScript (not WScript). CScript interprets the WScript.Echo command as a normal echo command and echos to the current environment - that is the command window. Since it has already echo'd to the command window, and since there is no "OK" button, the script execution continues and the command window is closed before you ever see the message.
WScript and CScript are both supported methods of executing VBS, but in this case, the expected results differ from the actual results. Echo is designed to be different than MSGBox. It just so happens that if you're in a Windows only version of the WSH, Echo has to echo to a Window, and thus the box is popped up.
The resolution is to call a message box directly using msgbox "hi" instead of wscript.echo. The result with msgbox will be exactly what is desired.
Imported Document ID: TECH140223
Subscribing will provide email updates when this Article is updated. Login is required.