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
This is machine translated content
Login to Subscribe
Please login to set up your
For security reasons, your link to this document has expired. Please click on the attachment link to access this file.
The attachment that you are looking for no longer exists.
There has been an issue retrieving your attachment. Please try again.
Currently server is down.
Didn't find the article you were looking for? Try these resources.