Job Output empty for deployed VB script.What are the way's available to write the job output.

Document ID : KB000005208
Last Modified Date : 14/02/2018
Show Technical Document Details

Job Output empty for deployed VB script.What are way's available to write the job output.


created a vbscript which included Microsoft KB patches (Exe's).  Made a package of this vbscript and deployed to couple of machines . Job working fine and successful but Job output is empty .


This probably comes down to how $rf is being used. The important thing to understand is that the $rf parameter only provides the process you are calling in your procedure with the full path to a FILENAME. This is a special file which is uploaded to the SS and then to the Domain when the job completes. How you write to that filename is up to you to determine. The $rf parameter in itself does not actually cause the Agent to gather any data for uploading, it is on you to use the parameter correctly.


$rf can be used in a couple of different ways:


1. Provided as a parameter to the process being called:

a. For example, the script or executable being called accepts a parameter which specifies a logfile it should write to, i.e. myprog.exe -l MyLogFile.txt -- in this case you would substitute $rf for MyLogFile.txt, the program writes to the file and the output is uploaded to the Domain.


2. Used with a redirect:


a. In this case, the process being run writes output to STDOUT and/or STDERR, which is redirected to $rf


b. To redirect only STDOUT use:


· myprog.exe > $rf


c. To redirect only STDERR (this is not common) use:


· myprog.exe 2> $rf


d. To redirect both STDOUT and STDERR use:


· Myprog.exe > $rf 2>&1


· This syntax actually redirects STDERR (always file handle 2) to STDOUT (always file handle 1), which in turn is redirected to $rf. This is necessary because you can’t redirect two streams to the same disk file.


· Some utilities write to both STDOUT and STDERR even when there is not an error, so this can be very useful.