Leaked source code of windows server 2003
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.

32 lines
820 B

  1. use OLE;
  2. use Win32;
  3. # Get a favorite class from CIMOM
  4. $locator = CreateObject OLE 'WbemScripting.SWbemLocator';
  5. $service = $locator->ConnectServer (".", "root/cimv2");
  6. $class = $service->Get('win32_logicaldisk="C:"');
  7. $d = $class->{Path_};
  8. #The default value doesn't work
  9. #print "$d\n";
  10. print "Path= $d->{Path}\n";
  11. print "RelPath= $d->{RelPath}\n";
  12. print "Class= $d->{Class}\n";
  13. print "Server= $d->{Server}\n";
  14. print "Namespace= $d->{Namespace}\n";
  15. print "DisplayName= $d->{DisplayName}\n";
  16. print "ParentNamespace= $d->{ParentNamespace}\n";
  17. print "IsClass= $d->{IsClass}\n";
  18. print "IsSingleton= $d->{IsSingleton}\n";
  19. # Now do the keys
  20. use Win32::OLE::Enum;
  21. $enum = Win32::OLE::Enum->new ($d->{Keys});
  22. while ($key = $enum->Next()) {
  23. print "Key: $key->{Name} = $key->{Value}\n";
  24. }