BEGIN
{
use Win32::TieRegistry( Delimiter=>"\\", ArrayValues=>0 );
$Registry = $Registry->Open('’, {Access => 0×2000000});
}
but perl complains
this was from Dave's post in his blog
Thanks
BEGIN
{
use Win32::TieRegistry( Delimiter=>"\\", ArrayValues=>0 );
$Registry = $Registry->Open('’, {Access => 0×2000000});
}
#!/usr/bin/perl -w
#BEGIN
#{
# use Win32::TieRegistry( Delimiter=>"\\", ArrayValues=>0 );
# $Registry = $Registry->Open(', {Access => 0×2000000});
#}
BEGIN
{
use Win32::TieRegistry( Delimiter=>"\\", ArrayValues=>0 );
$Registry = $Registry->Open('', {Access => 0×2000000});
}
sub sdat {
$Registry->Delimiter("/");
$sdat = $Registry->{"//$host/LMachine/SOFTWARE/Network Associates/TVD/Shared Components/VirusScan Engine/4.0.xx"}->{"szVirDefVer"};
if ($sdat) {
print report "<td>SDAT Version: $sdat</td>\n";
return 1; # returns 1 if true
}
else {
print report "<td>No SDAT</td>\n";
return 0; # returns 0 if false
}
}
# Open a Registry key:
$subKey= $key->Open( "SubKey/SubSubKey/", { Access=>KEY_READ, Delimiter=>"/" } );
sub sdat {
$myKey = $Registry->Open( $host, "LMachine/SOFTWARE/Network Associates/TVD/Shared Components/VirusScan Engine/4.0.xx", {Access=>KEY_READ, Delimiter=>"/"} ) || die;
$sdat = myKey->{"szVirDefVer"};
if ($sdat) {
print report "<td>SDAT Version: $sdat</td>\n";
return 1; # returns 1 if true
}
else {
print report "<td>No SDAT</td>\n";
return 0; # returns 0 if false
}
}
$sdat = myKey->{"szVirDefVer"};
sub sdat
{
my $myHive = $Registry->Connect( $host, "LMachine", {Access=>KEY_READ, Delimiter=>"/"} ) || die;
my $myKey = $myHive->{"Software/Microsoft/Network Associates/TVD/Shared Components/VirusScan Engine/4.0.xx"};
my $sdat = myKey->{"szVirDefVer"};
if ($sdat)
{
print report "<td>SDAT Version: $sdat</td>\n";
return 1; # returns 1 if true
}
else
{
print report "<td>No SDAT</td>\n";
return 0; # returns 0 if false
}
}
my $sdat = myKey->{"szVirDefVer"};
my $sdat = $myKey->{"szVirDefVer"};
sub sdat {
my $myHive = $Registry->Connect( $host, "LMachine", {Access=>KEY_READ, Delimiter=>"/"} ) || die;
my $myKey = $myHive->{"Software/Network Associates/TVD/Shared Components/VirusScan Engine/4.0.xx"};
my $sdat = $myKey->{"szVirDefVer"};
if ($sdat)
{
print REPORT "<td>SDAT Version: $sdat</td>\n";
return 1; # returns 1 if true
}
else
{
print REPORT "<td>No SDAT</td>\n";
return 0; # returns 0 if false
}
}
You must log in to post.