observe the code way below.... I need to apply these
patches on my remote machines by starting remote
processes on my client machines.

Now or i do
$objWMIService->Create("c\:\\temp\\MS04-012\.exe
\/passive \/norestart") or die("die die die");

it outputs as die die die

why?

and how do I get the processid of what has been
started on the remote machine... i know this can do
this via WMI but how do you implement this in perl

like
create(process,something,something,processid(output))

regards




use Win32::OLE;
use File::Copy;
#use Win32::FileOp;
$machinelist = "comp";
#$log = "log.txt";

open(ML,"$machinelist") or die "Cannot open file
$machinelist : $!";

#open(EL, ">> $log") or die "can't open $log: $!"

while($line = <ML>){
        chomp $line;
        print("$line\n");
        $objWMIService =
Win32::OLE->GetObject("winmgmts:\\\\$line\\root\\cimv2\:Win32_Process")
or die "oops\n";

copy("MS04-011.exe","\\\\$line\\c\$\\temp\\MS04-011\.exe")
or die("unable to copy");

copy("MS04-012.exe","\\\\$line\\c\$\\temp\\MS04-012\.exe")
or die("unable to copy");
        #Error = objWMIService.Create("notepad.exe", null,
null, intProcessID)
        #print("$Error\n");

$process=$objWMIService->Create("c\:\\temp\\MS04-011\.exe
\/passive \/norestart");
        print("$process\n");
        $objWMIService->Create("c\:\\temp\\MS04-012\.exe
\/passive \/norestart");
        #print("$Error\n");
        
}


        
                
__________________________________
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs  
http://hotjobs.sweepstakes.yahoo.com/careermakeover 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to