EyeOpener has asked for the wisdom of the Perl Monks concerning the following question:
For about a year, I've been running a script that uses Win32::OLE and CuteFTP's Transfer Engine. The pertinent part of the script begins like this:
use Win32::OLE qw(in with); use Win32::OLE::Const 'CuteFTPPro'; my $ftp = Win32::OLE->new('CuteFTPPro.TEConnection', 'Close') or die "Error: Can't create FTP object: $!"; print "FTP object created, continuing...\n";
This script runs unattended on a Windows 2000 machine, using Task Scheduler, running in the context of a service account I set up for this purpose. I have a new project that requires something similar, so I borrowed a bunch of this code from the working script.
My new script is complete, and runs fine when I run it manually from a command prompt, logged in as my service account. The problem is, the script hangs at this point when I run it unattended from Task Scheduler. The my $ftp = line never finishes: it doesn't print the die error, nor the following print statement. (I'm piping the output to a logfile, so I can see exactly where it hangs.) It will hang at this point until I kill the task.
I'm at a loss to explain it, and I can't figure out how to troubleshoot this. I don't have much visibility into the process when it's running as a scheduled task, so I don't know where to go with this. Does anyone have guesses as to what might be going on, or how to narrow it down? Any ideas would be appreciated - thanks!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Can't create Win32::OLE object
by cool_jr256 (Acolyte) on Jun 10, 2005 at 19:45 UTC | |
by EyeOpener (Scribe) on Jun 10, 2005 at 20:05 UTC | |
by ikegami (Patriarch) on Jun 10, 2005 at 20:20 UTC | |
by EyeOpener (Scribe) on Jun 10, 2005 at 19:55 UTC |