You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.0 KiB
42 lines
1.0 KiB
|
|
###############################################
|
|
# Brings out differences between:
|
|
# MKS
|
|
# ActiveState
|
|
# Standard distribution
|
|
#
|
|
# Turn this into a proper test, fail gracefully
|
|
# and print error messages
|
|
###############################################
|
|
|
|
#####################################################
|
|
# We need different preambles for each implementation
|
|
#####################################################
|
|
|
|
# Use these 4 lines to use ActiveState Perl
|
|
|
|
#use OLE;
|
|
#use Win32;
|
|
#$locator = CreateObject OLE 'Wbem.Locator';
|
|
#$services = $locator->ConnectServer();
|
|
|
|
# Use these 3 lines to use MKS Perl
|
|
|
|
#require COM;
|
|
#$locator = new IDispatch 'Wbem.Locator';
|
|
#$services = $locator->ConnectServer();
|
|
|
|
# Use these 4 lines to use "Standard" Perl
|
|
# This is the only one that can use a Moniker
|
|
use Win32::OLE;
|
|
use Win32::OLE::Enum;
|
|
$services = Win32::OLE->GetObject('winmgmts:');
|
|
|
|
$services->{Security_}->{ImpersonationLevel} = 3;
|
|
|
|
$cls = $services->Get("Win32_process");
|
|
|
|
$str = $cls->{Path_}->{Path};
|
|
print "class: $str";
|
|
|
|
|