Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

User Quota on Network Drive

Status
Not open for further replies.

JEngles

MIS
Joined
May 21, 2003
Messages
93
Location
AU
Hi I'm trying to write a simple HTA file that a user can click on a get all types of handy info. e.g MAC, IP, Computer Name and how much space there my documents they have used.

The thing is that there my documents has been re-directed to a network share, I tried the below script, but it will only work on a root drive.

Code:
Const MY_DOCUMENTS = &H5&

Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(MY_DOCUMENTS)
Set objFolderItem = objFolder.Self
Set colDiskQuotas = CreateObject("Microsoft.DiskQuota.1")

'WScript.Echo objFolderItem.Path & "\"
'\\bob-fs-a.vcom.local.\User$\UserName\

colDiskQuotas.Initialize objFolderItem.Path & "\", True
 
For Each objUser in colDiskQuotas
    Wscript.Echo "Logon name: " & objUser.LogonName
    Wscript.Echo "Quota used: " & objUser.QuotaUsed
Next

Does anyone have any ideas,

Cheers,
Johan
 
Easy here you go:
Just add code to make FolderPath point to your users folder
Code:
Const CONVERSION_FACTOR = 1048576 'converts folder size to MB
Dim FSO, UserFolder
FolderPath = "C:\Windows"
Set FSO = CreateObject ("Scripting.FileSystemObject")
Set UserFolder = FSO.GetFolder(FolderPath)  

WScript.Echo "Folder is " & Int(UserFolder.Size/ CONVERSION_FACTOR)& "MB in size"

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
 
How do I actually find the Users quota, so I can tell them how much they have left?
 
Quotas are enabled on the volume. Right click the volume and see what the max is set to. You can then subtract the result returned from that much to determine how much is left.

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
 
Is there any way to script that though? I want to have all this info easily available in a hta file.
 
The quota is a static value. Do it manually and code the value in the HTA. Quota is the same for all users on the volume.

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top