Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Re: Running exe's remotely

by Anonymous Monk
on Jan 31, 2003 at 11:31 UTC ( #231570=note: print w/replies, xml ) Need Help??


in reply to Re: Running exe's remotely
in thread Running exe's remotely

I use a Workstation module I wrote myself. one of the subs returns a WMI handle...

sub get_wmi {
        my $self = shift;
        my $name = $self->name or do { 
                warn("Cannot return WMI handle for anonymous workstation.\n");
                return 0; 
                };
        use Win32::OLE ;
        my $wmi = Win32::OLE->GetObject( "winmgmts:{impersonationLevel=impersonate,(security)}//$name");
        if ($wmi) {
              return $wmi;        
        }else{
              return 0;
        }   
}
You should then be able to do $wmi->CreateProcess("your.exe") or whatever (see MSDN.microsoft.com for details of WMI)...

Or Google for "perl+WMI" - or visit www.roth.net/perl/scripts

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://231570]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2022-12-07 00:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?