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.

51 lines
1.3 KiB

  1. @echo off
  2. if "%1" == "" goto Usage
  3. if "%1" == "help" goto Usage
  4. if "%1" == "-?" goto Usage
  5. if "%1" == "/?" goto Usage
  6. if "%1" == "-help" goto Usage
  7. if "%1" == "/help" goto Usage
  8. setlocal
  9. set DriveLetter=%1
  10. set VolumePath=%1\
  11. set QueryVolumePath='%VolumePath%\'
  12. wmic volume where name=%QueryVolumePath% get name,capacity,freespace,dirtybitset
  13. if errorlevel 1 (
  14. echo volume not found
  15. goto :eof
  16. )
  17. set cmdx="wmic volume where name=%QueryVolumePath% get deviceid"
  18. for /f "tokens=1,2" %%a in ('%cmdx%') do (
  19. VolumeID=%%a
  20. )
  21. @rem --- VolumeQuota setting association test ---
  22. echo ====
  23. echo ==== associators of %VolumePath% through Win32_VolumeQuota class
  24. echo ====
  25. wmic volume where name=%QueryVolumePath% assoc /assocclass:Win32_VolumeQuota
  26. echo ====
  27. echo ==== associators of %VolumePath% through Win32_VolumeUserQuota class
  28. echo ====
  29. wmic volume where name=%QueryVolumePath% assoc /assocclass:Win32_VolumeUserQuota
  30. @rem TODO: set quota limits for admin? account
  31. @rem need a way to choose a specific Win32_VolumeUserQuota and then
  32. @rem do a set operation
  33. echo ---- List All VolumeUserQuota ----
  34. @rem wmic volumeuserquota list brief
  35. @rem wmic volumeuserquota list status
  36. @rem wmic volumeuserquota list full
  37. endlocal
  38. goto :eof
  39. :Usage
  40. echo wmicquota driveLetter: