Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Perl script runs from command prompt but not from Task Scheduler in Win2000

Reply
Thread Tools

Perl script runs from command prompt but not from Task Scheduler in Win2000

 
 
kpowell10
Guest
Posts: n/a
 
      05-07-2004
Hi all,

I have a script that runs fine from the command prompt, but that fails
when I run it from Task Scheduler.

Apparently the line that is failing is an OLE module command:
$xlworkbook = $xl_app->Workbooks->Add;

Any ideas what might cause this behavior or how to pin down the cause?
I'm getting no errors messages of any sort in the Event Viewer.
Thanks,

Kyle
 
Reply With Quote
 
 
 
 
Mark Clements
Guest
Posts: n/a
 
      05-07-2004
kpowell10 wrote:

> I have a script that runs fine from the command prompt, but that fails
> when I run it from Task Scheduler.
>
> Apparently the line that is failing is an OLE module command:
> $xlworkbook = $xl_app->Workbooks->Add;
>
> Any ideas what might cause this behavior or how to pin down the cause?
> I'm getting no errors messages of any sort in the Event Viewer.


what happens if you wrap it in an eval {} and dump $@ somewhere?

Mark
 
Reply With Quote
 
 
 
 
Richard Morse
Guest
Posts: n/a
 
      05-07-2004
In article <409bae44$(E-Mail Removed)>,
Mark Clements <(E-Mail Removed)> wrote:

> kpowell10 wrote:
>
> > I have a script that runs fine from the command prompt, but that fails
> > when I run it from Task Scheduler.
> >
> > Apparently the line that is failing is an OLE module command:
> > $xlworkbook = $xl_app->Workbooks->Add;
> >
> > Any ideas what might cause this behavior or how to pin down the cause?
> > I'm getting no errors messages of any sort in the Event Viewer.

>
> what happens if you wrap it in an eval {} and dump $@ somewhere?


Or put a line like the following at the start of the script:

open(STDERR, ">>", "c:/temp/odd_errors")
or die("can't change STDERR: $!"); # yes, I see the problem
open(STDOUT, ">>", "c:/temp/odd_output")
or die("can't change STDOUT: $!");

warn (('-' x 5) . ' ' . scalar(localtime) . "\n");

....


HTH,
Ricky

--
Pukku
 
Reply With Quote
 
Brian Helterline
Guest
Posts: n/a
 
      05-07-2004
"Richard Morse" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Or put a line like the following at the start of the script:
>
> open(STDERR, ">>", "c:/temp/odd_errors")
> or die("can't change STDERR: $!"); # yes, I see the problem
> open(STDOUT, ">>", "c:/temp/odd_output")
> or die("can't change STDOUT: $!");


or better yet, put it in a BEGIN block to catch compile time info


 
Reply With Quote
 
Ben Morrow
Guest
Posts: n/a
 
      05-07-2004

Quoth http://www.velocityreviews.com/forums/(E-Mail Removed) (kpowell10):
> Hi all,
>
> I have a script that runs fine from the command prompt, but that fails
> when I run it from Task Scheduler.
>
> Apparently the line that is failing is an OLE module command:
> $xlworkbook = $xl_app->Workbooks->Add;
>
> Any ideas what might cause this behavior or how to pin down the cause?


You probably don't have Excel running when the task is scheduled. IIRC
there is an OLE call that will create a new instance of
Excel.Application, or return a running one if there is one...?

Ben

--
If you put all the prophets, | You'd have so much more reason
Mystics and saints | Than ever was born
In one room together, | Out of all of the conflicts of time.
(E-Mail Removed) The Levellers, 'Believers'
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dotnet scheduler like the Windows "Schedued Tasks" scheduler? Codemonkey ASP .Net 8 06-10-2011 10:53 AM
FAQ 9.2 My CGI script runs from the command line but not the browser. (500 Server Error) PerlFAQ Server Perl Misc 0 03-15-2011 04:00 PM
Rhino: Script runs from command line, but not from browser gh@nsbasic.com Javascript 10 10-01-2007 09:12 PM
Example script -- Group Project Task Scheduler nickel_and_dime_2death@yahoo.com Python 0 09-07-2007 05:39 PM
Active Perl, Windows scheduler, regular task... Alan J. Flavell Perl Misc 7 09-10-2003 12:33 AM



Advertisments