1 of 1 people found this helpful
Take a look at the sdclient /msg="your message here" functions. If you launch sdclient with this parameter from your script, you could pass back your actual message into the scheduled task pane.
Mark Star - MarXtar LANDesk Enhancements
Home of Power State Notifier & Wake-On-WAN for LANDesk
take a look at this document: About Batch File Distribution Packages
This document describes how to use batches to distribute packages but it describes the way to send messages to LANDesk too (s. page 33ff)
ahe...Thanks for the info. I found the following in the PDF you referenced.
NOTE: The failure string displayed in the task may be incorrect as batch files are linked to facility 7, Microsoft, which results in the Win32 strings being displayed on the console regardless of what command in the batch file really returned the error. Except when using the basic batch file to deploy an MSI file or other Win32® tasks, the failure string on the console should be ignored.
From that paragraph, it sounds like the failure strings you see in the console when running a scheduled task cannot be modified.
Thanks for the suggestion. I tried calling sdclient /msg="your message here" from within the script. I still end up with a status as I originally posted it. Do you know of any other information on how sdclient operates and how it could be used in a vbscript?
The suggestion to call sdclient /msg was never going to change the way in which exit codes are being interpreted. As you have found, the exit code of a vbscript package always seems to be interpreted as a Win32 error code and nothing is going to change that.
What sdclient /msg will do is generate a message that will appear in the message column of scheduled tasks. One thing you need to know if you are going to run sdclient /msg from within a vb script is that a vbscript "exec" runs asynchronously. If you "exec" sdclient /msg and then immediately exit, you vb script will terminate before sdclient has had a chance to do its thing and the message will never appear. You need to a little loop as shown below to wait for sdclient:
Dim WshShell, oExec
Set WshShell = CreateObject("WScript.Shell")
Set oExec = WshShell.Exec("""c:\program files\landesk\ldclient\sdclient"" /msg=""vbtest message 1""")
Do While oExec.Status = 0
I also chose to use an exit code (29001) that means nothing as a Win32 error code. When you run the above as a package, what will appear in scheduled tasks is Failed, unknown status code(0x80077149,7:29001), vbtest message 1. I thought you might prefer that to a bogus Win32 error.
Thanks for the info Jan! Very helpful!