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.

73 lines
2.0 KiB

  1. ' Set the locale and check display name is OK
  2. WScript.Echo "Pass 1 - Set locale in SWbemObjectPath"
  3. WScript.Echo "======================================"
  4. WScript.Echo
  5. set obj = CreateObject ("WbemScripting.SWbemObjectPath")
  6. obj.Security_.impersonationLevel = 3
  7. obj.Server = "myServer"
  8. obj.Namespace = "root\default"
  9. obj.Locale = "ms_0x409"
  10. WScript.Echo obj.Locale
  11. WScript.Echo obj.DisplayName
  12. WScript.Echo
  13. WScript.Echo
  14. 'Now feed the display name the object
  15. WScript.Echo "Pass 2 - Set locale in Display Name"
  16. WScript.Echo "==================================="
  17. WScript.Echo
  18. obj.DisplayName = "winmgmts:[locale=ms_0x409]!root\splodge"
  19. WScript.Echo obj.Locale
  20. WScript.Echo obj.DisplayName
  21. WScript.Echo
  22. WScript.Echo
  23. 'Now Set locale direct
  24. WScript.Echo "Pass 3 - Set locale directly"
  25. WScript.Echo "============================"
  26. WScript.Echo
  27. obj.DisplayName = "winmgmts:root\splodge"
  28. obj.Locale = "ms_0x408"
  29. WScript.Echo obj.Locale
  30. WScript.Echo obj.DisplayName
  31. obj.Locale = vbNullString
  32. WScript.Echo obj.Locale
  33. WScript.Echo obj.DisplayName
  34. obj.Locale = ""
  35. WScript.Echo obj.Locale
  36. WScript.Echo obj.DisplayName
  37. WScript.Echo
  38. WScript.Echo
  39. 'Plug the locale into the moniker
  40. WScript.Echo "Pass 4 - Set locale in moniker"
  41. WScript.Echo "============================="
  42. WScript.Echo
  43. set Service = GetObject ("winmgmts:[locale=ms_0x409]!root\default")
  44. set cim = Service.Get ("__cimomidentification=@")
  45. WScript.Echo cim.Path_.Locale
  46. WScript.Echo cim.Path_.DisplayName
  47. WScript.Echo
  48. WScript.Echo
  49. 'Plug the locale into ConnectServer
  50. WScript.Echo "Pass 4 - Set locale in ConnectServer"
  51. WScript.Echo "===================================="
  52. WScript.Echo
  53. set Locator = CreateObject ("WbemScripting.SWbemLocator")
  54. set Service = Locator.ConnectServer (,,,,"ms_0x409")
  55. Service.Security_.impersonationLevel = 3
  56. set disk = Service.Get ("Win32_LogicalDisk=""C:""")
  57. WScript.Echo disk.Path_.locale
  58. WScript.Echo disk.Path_.DisplayName
  59. WScript.Echo
  60. WScript.Echo