sreekanth.adari has asked for the wisdom of the Perl Monks concerning the following question:

Hi When I run script manually, it is working, but my windows Task Scheduler run the script so that script send email which it should be doing but with out any output. My script shoud do few things :
1. Run A command 2. Send output of the command to my email Below is the Script : #!C:/Perl/bin/perl.exe use Mail::Sendmail; my $to_list = 'sadari@travco.co.uk'; my $email = "\n\nThis email was generated automatically.\n"; my $MailFrom = "storageadmalerts\@travco.co.uk"; my $subject = "Storage Array pool Status"; my $cmd = qx(raidcom get pool); my $message = "$cmd"; %mail = ( To => $to_list, From => $MailFrom, Bcc => $bcc_list, Cc => $cc_list, Subject => $subject, Message => $message ); $mail{Smtp} = 'mailtest.gmail.com'; sendmail(%mail)

Replies are listed 'Best First'.
Re: Script Failing to Run through Task Scheduler in Windows
by i5513 (Pilgrim) on Feb 05, 2015 at 11:06 UTC
    This seems like Html not printing my shell command output
    Check that raidcom is in the path (print path to any file) when Task Manager exec your task.
    I hope this help
    Hint: Use code tag to paste your code
      Thanks a lot for the reply... I copied the script to the correct path and trigger the script using task scheduler. Do I need to write the path as well before the command ?
        I think you can update your PATH with (I did not test this on windows):
        $ENV{PATH}="C:\\xxx\\yyy"