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.

17 lines
498 B

  1. var Disk = GetObject ('winmgmts:{impersonationLevel=impersonate}!Win32_LogicalDisk="C:"');
  2. var Keys = Disk.Path_.Keys;
  3. var e = new Enumerator (Keys);
  4. for (;!e.atEnd();e.moveNext ())
  5. {
  6. var y = e.item ();
  7. WScript.Echo ("Key has name", y.Name, "and value", y.Value);
  8. }
  9. var Names = new ActiveXObject("WbemScripting.SWbemNamedValueSet");
  10. var Value = Names.Add ("fred", 25);
  11. WScript.Echo ("Named Value Set contains a value called", Value.Name,
  12. "which is set to", Value.Value);