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.

47 lines
1.3 KiB

  1. Set Args = wscript.Arguments
  2. Set regSR = GetObject("winmgmts:{impersonationLevel=impersonate}!root/default:SystemRestoreConfig='SR'")
  3. If Args.Count() = 0 Then
  4. Wscript.Echo "Usage: RegSR [RP{Session|Global|Life}Interval[=value]] [DiskPercent[=value]]"
  5. Else
  6. For i = 0 To Args.Count() - 1
  7. Myarg = Args.Item(i)
  8. Pos = InStr(Myarg, "=")
  9. If Pos <> 0 Then
  10. Myarray = Split(Myarg, "=", -1, 1)
  11. myoption = Myarray(0)
  12. value = Myarray(1)
  13. Else
  14. myoption = Myarg
  15. End If
  16. If myoption = "RPSessionInterval" Then
  17. If Pos = 0 Then
  18. Wscript.Echo "RPSessionInterval = " & regSR.RPSessionInterval
  19. Else
  20. regSR.RPSessionInterval = value
  21. regSR.Put_
  22. End If
  23. ElseIf myoption = "RPGlobalInterval" Then
  24. If Pos = 0 Then
  25. Wscript.Echo "RPGlobalInterval = " & regSR.RPGlobalInterval
  26. Else
  27. regSR.RPGlobalInterval = value
  28. regSR.Put_
  29. End If
  30. ElseIf myoption = "RPLifeInterval" Then
  31. If Pos = 0 Then
  32. Wscript.Echo "RPLifeInterval = " & regSR.RPLifeInterval
  33. Else
  34. regSR.RPLifeInterval = value
  35. regSR.Put_
  36. End If
  37. ElseIf myoption = "DiskPercent" Then
  38. If Pos = 0 Then
  39. Wscript.Echo "DiskPercent = " & regSR.DiskPercent
  40. Else
  41. regSR.DiskPercent = value
  42. regSR.Put_
  43. End If
  44. End If
  45. Next
  46. End If