Automic Workload Automation

 View Only

  • 1.  Email output of a batch file

    Posted Apr 30, 2025 03:26 PM

    How can I email the output of a batch file?  Following is the report from the UC4 job.  I want UC4 to capture 'RowCount: 189' and email it.

    c:\>C:\Automic\Agents\windows\bin\UCXJWX6M.EXE JNR=0090666969 MNR=0010 PNR=2300 IPA=10.4.42.30 TYP=S TXT="        Job started" LOCAL=1 IPC=\\.\pipe\Automic_2300 TRC=0 
    Program 'UC4 Job Messenger' version '21.0.11+build.1720097423884' started
    UCMDJP: *********************************************************************
    UCMDJP: ** JOB 0090666969 (ProcID:0000000516) START AT 30.04.2025/14:01:43 **
    UCMDJP: **                                    UTC TIME 30.04.2025/18:01:43 **
    UCMDJP: ** --------------------------------------------------------------- **
    UCMDJP: **                                    USED:      0.000 CPU         **
    UCMDJP: *********************************************************************
    Program 'UC4 Job Messenger' version '21.0.11+build.1720097423884' terminated normally
    Disconnected from '127.0.0.1:2300' (socket handle = '1').
    
    c:\>C:\Test\row_count.bat
    RowCount: 189
    Deleting instance \\SA01-AG101-W10\ROOT\CIMV2:Win32_Process.Handle="9808"
    
    Instance deletion successful.


  • 2.  RE: Email output of a batch file

    Posted Apr 30, 2025 04:18 PM

    There's a few ways to go about this...

    Are you looking to send the entire Report (like you're showing in your screenshot), or just capture and email out the rowcount?

    If the former, I would suggest looking into Notification objects; there's a simple way to attach the reports for whatever run# you're after.  (You would just need to update your job to store the run# in a script variable that could be passed along to your notification object.)

    If the latter -- which is the way I would approach it in this case -- then I would add a PREP_PROCESS_REPORT call on this job's PostProcess tab to read in your row count (e.g., parse for lines matching "RowCount*" with a delimiter of ":", and capture the second value), and then use the SEND_MAIL function to email out a simple message stating what your row count was.




  • 3.  RE: Email output of a batch file

    Posted May 02, 2025 04:22 PM

    That worked.  Thanks for your help.