I have been trying to compile the follow code in Activestate Perl Dev Kit 6.0 on an Windows XP system.

#!perl

use Win32::OLE qw(in);
use File::Copy;
use Digest::MD5;
use File::Basename;


my ($status_ini_file, %msg);

$PasswordTesting = 0;
$status_ini_file = "s:\\Program Files\\CA\\AllFusion Harvest Change Manager\\Processes\\statusinifile.ini";

%status_ini_hash = &get_ini ($status_ini_file);
$msg = $status_ini_hash{"stopservice"}{"Qualmachines"};
print "(1)msg = $msg\n";

@stopserviceARG = split(/,/, $msg);
print "stopserviceARG array = @stopserviceARG\n";

$PackageCounter = 0;
foreach $package (@stopserviceARG)
{  
  $packageArray ="$package";
  print "Package array = $packageArray\n";
 
  $serviceinquestion = 'Messenger';
  print "$serviceinquestion\n";
 
  ######################################################################
  # stopping the sevice
  ######################################################################
 
  $LoopCounter=0;
  while ($LoopCounter < 10)
  {
          $strComputer = '.';
    $objWMIService = Win32::OLE->GetObject('winmgmts:\\\\' . $strComputer . '\\root\\cimv2');
    $colRunningServices = $objWMIService->ExecQuery('Select * from Win32_Service where DisplayName = "' . $serviceinquestion. '"', undef, 48);
   
    foreach my $objService (in $colRunningServices)
    {
            if ($objService->DisplayName eq $serviceinquestion)
            {
                            if ($objService->State eq 'Stopped')
                            {
                                    print 'The Service ' . $objService->DisplayName . ' is : ' . $objService->State, "\n";
            $LoopCounter=150;
          } # end of if ($objService->State eq 'Running')
                                    print 'The Service ' . $objService->DisplayName . ' is : ' . $objService->State, "\n";
                            if ($objService->State eq 'Running')
                            {
                                    $cmdline = "net stop \"$serviceinquestion\"";
            system "$cmdline";
          }
  #        sleep 15;
          $LoopCounter++;
      } # end of if ($objService->DisplayName eq '$serviceinquestion')
    } # end of foreach my $objService (in $colRunningServices)
  } # end of while ($LoopCounter < 10)
  $PackageCounter++;
}  
 
print " \n";
print "Now that the Service has been stopped will proceed to restart the service\n";
print " \n";

Am receiving the following error when making an executable. I get this error with any call to use WIN32.

Can't load 'C:/Perl/site/lib/auto/Win32/OLE/OLE.dll' for module Win32::OLE: load_file:The specified module could not be found at /PerlApp/DynaLoader.pm line 212.
 at S:\Program Files\CA\AllFusion Harvest Change Manager\Processes\winstatuscheck2.pl line 37
Compilation failed in require at S:\Program Files\CA\AllFusion Harvest Change Manager\Processes\winstatuscheck2.pl line 37.
BEGIN failed--compilation aborted at S:\Program Files\CA\AllFusion Harvest Change Manager\Processes\winstatuscheck2.pl line 37.
'S:\Program Files\CA\AllFusion Harvest Change Manager\Processes\winstatuscheck2.pl' had compilation errors.

[DONE]



Daniel C Hume
Senior Change Control Analyst
The Hertz Corporation
5601 NW Expressway
Oklahoma City, Oklahoma 73132
USA
405-264-8225
[EMAIL PROTECTED]

---------------
This message (including attachments) may contain information that is privileged, confidential or protected from disclosure.  If you are not the intended recipient, you are hereby notified that dissemination, disclosure, copying, distribution or use of this message or any information contained in it is strictly prohibited.  If you have received this message in error, please immediately notify the sender by reply e-mail and delete this message from your computer.  Although we have taken steps to ensure that this e-mail and attachments are free from any virus, we advise that in keeping with good computing practice the recipient should ensure they are actually virus free.
---------------
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to