Enable disk quotas (VBScript)
This code can be found in
Chapter 7 of Windows XP Cookbook
Purchase XP Cookbook or Networking Recipes for only $25 plus shipping! While supplies last.
Find out how to download all of the VBScript code from this site.
' From the book, "Windows XP Cookbook"
' ISBN: 0596007256
' ------ SCRIPT CONFIGURATION ------
strComputer = "."
strDrive = "<Drive>" ' e.g. D:
intEnable = 2 ' 0 = Disabled, 1 = Tracked, 2 = Enforced
intDefaultLimit = 1024 * 1024 * 500 ' 500 MB
intDefaultWarning = 1024 * 1024 * 400 ' 400 MB
' ------ END CONFIGURATION ---------
set objWMI = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
set objDisk = objWMI.Get("Win32_QuotaSetting.VolumePath='" & strDrive & "\\'")
objDisk.State = intEnable
objDisk.ExceededNotification = True
objDisk.WarningExceededNotification = True
objDisk.DefaultLimit = intDefaultLimit
objDisk.DefaultWarningLimit = intDefaultWarning
objDisk.Put_
WScript.Echo "Quotas enabled on " & objDisk.Caption
|
This code has been viewed 780 times.
|
New from the creators of TechTasks.com:
StatSheet.com
|