Perl, WMI remote process

From: Saadat Saeed (saadat_saeed_at_yahoo.com)
Date: 04/28/04


Date: Wed, 28 Apr 2004 05:54:49 -0700 (PDT)
To: beginners@perl.org

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



Relevant Pages

  • Re: remote shutdown
    ... Remote computer is on peer network, and I can ping the remote ... Those should work great - if you are a system administrator of the ... Two machines in a workgroup. ...
    (microsoft.public.windowsxp.work_remotely)
  • Re: Home Network Dilemma
    ... Microsoft Windows XP Professional version 5.1.2600 Service Pack 3 Build ... and the Vista machines for an hour now. ... "What is Remote Desktop Connection?": ...
    (microsoft.public.windows.server.networking)
  • RE: Help and Support - Windows 2000 Upgrade to XP
    ... Please use the problematic upgraded XP SP2 machine to initiate a Remote ... Assistance - as a Solicited Remote Assistance. ... Is there any difference between the upgraded XP SP2 computers and OEM XP ... -ANSWER- All of the upgraded machines are HP machines, ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: Summary of Survey: Age & Years of Machining Experience
    ... Those figures were the average manufacturing wage. ... on a tool and die presentation given by a classmate's father. ... machines or CNC. ... I first saw a CNC Swiss at a machine tool show in Hartford. ...
    (alt.machines.cnc)
  • Re: Home Network Dilemma
    ... then you just need to install a remote control program on ... The Vista computer already has the software needed to connect to remote ... Install something like VNC. ... The later two machines have legal copies of Office 2003 Professional. ...
    (microsoft.public.windows.server.networking)