ArchitectureAgnosticRegistry.vbs 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. ' Notes: wanted to implement this using a class but:
  2. ' 1. No matter what I did I could not assign the result of GetObject to a private member
  3. ' 2. It looks as if all methods were treated as subs from the outside world which is not good since
  4. ' some of these need to return a value
  5. '
  6. Set private_oReg = GetObject("winmgmts:\root\default:StdRegProv")
  7. Function SetStringValue(constHive, strSubKey, strValueName, strValue)
  8. SetStringValue = private_oReg.SetStringValue(constHive, strSubKey, strValueName, strValue)
  9. End Function
  10. Sub GetStringValue(constHive, strKey, strValueName, strValue)
  11. private_oReg.GetStringValue constHive, strKey, strValueName, strValue
  12. End Sub
  13. Function SetExpandedStringValue(constHive, strSubKey, strValueName, strValue)
  14. SetExpandedStringValue = private_oReg.SetExpandedStringValue(constHive, strSubKey, strValueName, strValue)
  15. End Function
  16. Sub GetExpandedStringValue(constHive, strKey, strValueName, strValue)
  17. private_oReg.GetExpandedStringValue constHive, strKey, strValueName, strValue
  18. End Sub
  19. Function SetMultiStringValue(constHive, strSubKey, strValueName, arrValue)
  20. SetMultiStringValue = private_oReg.SetMultiStringValue(constHive, strSubKey, strValueName, arrValue)
  21. End Function
  22. Sub GetMultiStringValue(constHive, strKey, strValueName, arrStrValue)
  23. private_oReg.GetMultiStringValue constHive, strKey, strValueName, arrStrValue
  24. End Sub
  25. Function SetDWORDValue(constHive, strSubKey, strValueName, arrValue)
  26. SetDWORDValue = private_oReg.SetDWORDValue(constHive, strSubKey, strValueName, arrValue)
  27. End Function
  28. Sub GetDWORDValue(constHive, strKey, strValueName, intDWordValue)
  29. private_oReg.GetDWORDValue constHive, strKey, strValueName, intDWordValue
  30. End Sub
  31. Function SetQWORDValue(constHive, strSubKey, strValueName, strQWordValue)
  32. SetQWORDValue = private_oReg.SetQWORDValue(constHive, strSubKey, strValueName, strQWordValue)
  33. End Function
  34. Sub GetQWORDValue(constHive, strKey, strValueName, intQWordValue)
  35. private_oReg.GetQWORDValue constHive, strKey, strValueName, intQWordValue
  36. End Sub
  37. Function SetBinaryValue(constHive, strSubKey, strValueName, arrValue)
  38. SetBinaryValue = private_oReg.SetBinaryValue(constHive, strSubKey, strValueName, arrValue)
  39. End Function
  40. Sub GetBinaryValue(constHive, strKey, strValueName, arrBinaryValue)
  41. private_oReg.GetBinaryValue constHive, strKey, strValueName, arrBinaryValue
  42. End Sub
  43. Function EnumKey(constHive, strSubKey, arrKeyNames)
  44. EnumKey = private_oReg.EnumKey(constHive, strSubKey, arrKeyNames)
  45. End Function
  46. Function EnumValues(constHive, strSubKey, arrValueNames, arrValueTypes)
  47. EnumValues = private_oReg.EnumValues(constHive, strSubKey, arrValueNames, arrValueTypes)
  48. End Function
  49. Function CreateKey(constHive, strSubKey)
  50. CreateKey = private_oReg.CreateKey(constHive, strSubKey)
  51. End Function
  52. Function DeleteKey(constHive, strSubKey)
  53. DeleteKey = private_oReg.DeleteKey(constHive, strSubKey)
  54. End Function
  55. Function DeleteValue(constHive, strSubKey, strValue)
  56. DeleteValue = private_oReg.DeleteValue(constHive, strSubKey, strValue)
  57. End Function