我正在运行一个 perl 脚本,该脚本从 ftp 服务器获取文件,然后执行系统命令。
当我从调度程序运行任务时,它不会抓取文件,但会执行系统命令。两者都包含在 if 语句中,所以我知道 if 语句工作正常。
我已经检查了权限,并且任务正在使用最高权限。我也以管理员身份运行该任务。现在,问题是当我手动运行程序时,一切正常。为什么当我手动运行它时它可以正常运行,但当我通过调度程序运行它时却不能?
这是一些代码:
if ($size_ftp == $size_local) {
print "Files are the same...\n";
$ftp->quit;
print "FTP has quit!\n";
} else {
print "Files are not the same...begin download!\n";
$ftp->get($file_ftp) or die "get failed ", $ftp->message;
print "Download complete...\n";
$ftp->quit;
print "FTP has quit!\n";
my $Archive_file = Archive::Extract -> new( archive => $file_dir );
print "File extraction identified...\n";
$Archive_file -> extract( to => $extract_here );
print "File extracted...\n";
system('call "C:\QMSEDX.exe"');
print "System EDX call completed!\n";
}