well, my luck here is probably better that yours, because your latest unmodified script works
with some non-zero results, after I added a task. Look:
D:\>at 20:20 /interactive /every:5 calc
Added a new job with job ID = 2
D:\Personal\perl\admin\tst>perl -w am.pl
==>0
==>1/8
Job 2 is calc
1/8 is hash in scalar context, you ignore "8" and see that you have
one single key in that hash.
Slightly reorganize code and see that we've got what we searched for:
use strict;
use Win32::AdminMisc;
my $server="\\\\serverserversevverv";
my %JobInfo;
my $Day;
my @DOM;
my %Jobs;
my $Number;
Win32::AdminMisc::ScheduleList($server, \%Jobs);
print "==>".%Jobs."\n";
foreach $Number (keys(%Jobs)){
print "Job $Number is $Jobs{$Number}->{Command}\n";
if (Win32::AdminMisc::ScheduleGet($server, $Number, \%JobInfo)){
foreach $Day (1..31){
push(@DOM, $Day) if ($JobInfo{DOM} & 2**$Day);
}
print "This job will run on the following days of the month:\n
+";
print join(", ", @DOM);
}
}
the output is not that bad in my case:
D:\Personal\perl\admin\tst>perl -w am.pl
==>2/8
Job 2 is calc
This job will run on the following days of the month:
4Job 3 is calc
This job will run on the following days of the month:
4, 18
let me know if you need more details.
Courage, the Cowardly Dog.
PS. Something fishy is going on there, or my name is Vadim Konovalov. And it's not.