Code: Select all
@echo off
cscript quota.vbs //nologo >quota.txt
FOR /F "delims=, tokens=2" %%G IN (quota.txt) DO @echo %%G | findstr User
Thank you very much
quota.vbs
Code: Select all
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
strDrive = "Win32_LogicalDisk.DeviceID=" & chr(34) & "F:" & chr(34)
Set colQuotas = objWMIService.ExecQuery _
("Select * from Win32_DiskQuota Where Status = 2")
For Each objQuota in colQuotas
Wscript.Echo "User: "& objQuota.User
'Wscript.Echo "Disk Space Used: "& objQuota.DiskSpaceUsed
Next
quota.txt
Code: Select all
User: Win32_Account.Domain="srv",Name="User456"
User: Win32_Account.Domain="srv",Name="User369"
User: Win32_Account.Domain="srv",Name="User789"
User: Win32_Account.Domain="srv",Name="User987"