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.

89 lines
2.5 KiB

  1. on error resume next
  2. set nvs = CreateObject("WbemScripting.SWbemNamedValueSet")
  3. nvs.AddAs "Fred", 10, 2
  4. WScript.Echo "2:", nvs("Fred").CIMType
  5. nvs.Add "Fred2", 11
  6. WScript.Echo "2:", nvs("Fred2").CIMType
  7. nvs("Fred2").CIMType = 3
  8. WScript.Echo "3:", nvs("Fred2").CIMType
  9. nvs("Fred2") = "Woobit"
  10. WScript.Echo "8:", nvs("Fred2").CIMType
  11. WScript.Echo ""
  12. WScript.Echo "Datetime"
  13. WScript.Echo "++++++++"
  14. WScript.Echo ""
  15. nvs.AddAs "Datetime", "20000217100430.000000+060", 101
  16. WScript.Echo "101:", nvs("Datetime").CIMType
  17. nvs.AddAs "DateArray", Array("20000217100430.000000+060", "20000217100430.000000+061"), 101
  18. WScript.Echo "101:", nvs("DateArray").CIMType
  19. nvs.AddAs "DateArrayBad", Array("20000217100430.000000+060", "0000217100430.000000+061"), 101
  20. if err <> 0 then
  21. WScript.Echo "TypeMismatch:", Err.Description, Err.Source
  22. err.clear
  23. else
  24. WScript.Echo "Error!"
  25. end if
  26. WScript.Echo ""
  27. WScript.Echo "Reference"
  28. WScript.Echo "+++++++++"
  29. WScript.Echo ""
  30. nvs.AddAs "Reference", "//wwo/root/default:fred=10", 102
  31. WScript.Echo "102:", nvs("Reference").CIMType
  32. nvs.AddAs "ReferenceArray", Array("//wwo/root/default:fred=10","root/cimv2:Disk"), 102
  33. WScript.Echo "102:", nvs("ReferenceArray").CIMType
  34. nvs.AddAs "ReferenceArrayBad", Array("//wwo/root/default:fred=10","root::cimv2:Disk"), 102
  35. if err <> 0 then
  36. WScript.Echo "TypeMismatch:", Err.Description, Err.Source
  37. err.clear
  38. else
  39. WScript.Echo "Error!"
  40. end if
  41. WScript.Echo ""
  42. WScript.Echo "Sint64"
  43. WScript.Echo "++++++++"
  44. WScript.Echo ""
  45. nvs.AddAs "Sint64", "2000021710043022222", 20
  46. WScript.Echo "20:", nvs("Sint64").CIMType
  47. nvs.AddAs "Sint64Array", Array("-2000021710043022222","2000021710043022222"), 20
  48. WScript.Echo "20:", nvs("Sint64Array").CIMType
  49. nvs.AddAs "Sint64ArrayBad", Array("-2000021710043022222","-20000217100430222222222"), 20
  50. if err <> 0 then
  51. WScript.Echo "TypeMismatch:", Err.Description, Err.Source
  52. err.clear
  53. else
  54. WScript.Echo "Error!"
  55. end if
  56. WScript.Echo ""
  57. WScript.Echo "Uint64"
  58. WScript.Echo "++++++++"
  59. WScript.Echo ""
  60. nvs.AddAs "Uint64", "10000217100430222222", 21
  61. WScript.Echo "21:", nvs("Uint64").CIMType
  62. nvs.AddAs "Uint64Array", Array("10000217100430222222","10000217100430222223"), 21
  63. WScript.Echo "21:", nvs("Uint64Array").CIMType
  64. nvs.AddAs "Uint64ArrayBad", Array("10000217100430222222","1000021710043022222222222"), 21
  65. if err <> 0 then
  66. WScript.Echo "TypeMismatch:", Err.Description, Err.Source
  67. err.clear
  68. else
  69. WScript.Echo "Error!"
  70. end if