Windows IT Pro is the authoritative and independent resource for windows nt, windows 2000, windows 2003, windows xp. Features a collection of resources and magazines for windows IT professionals.
  
  
  Advanced Search 


August 08, 2005

Handy HTAs: Set and Display User Quotas

This sample utility shows you how to create input forms
RSS
View this exclusive article with VIP access -- click here to join |
See More VBScript Articles Here | Reprints | Or sign up for our VIP Monthly Pass!

RunMod. The RunMod subroutine, which is associated with the Run Modify User Quotas button, contains the code for modifying user quotas. Aside from clearing the Status field value (using the statement statval.value = ""), the code checks for the presence of a carriage return or line feed at the end of the User ID input field. A carriage return or line feed is necessary to acquire the final ID, so if one isn't present, the code adds one. RunMod uses the Split function with the vbcrlf delimiter to build an array of user IDs, which the HTA later uses to set the quotas.

The script then assigns the values from the HTA input screen to variables, which are used throughout the script. The script uses GetObject to retrieve an instance of a class. The script uses the Win32_DiskQuota class for both the RunMod and RunQuery subroutines and uses the Win32_ComputerSystem class to retrieve the local computer name when the user leaves the domain input field blank.

The meat and potatoes of the RunMod subroutine takes place at callout A in Listing 1. Here, the subroutine cycles through the user IDs. For each ID, the subroutine retrieves a specific user quota, sets the limit, and commits it by using the objQuota.Put_ method. . . .

Reader Comments
Where is the article ?

basit601 October 01, 2008 (Article Rating: )


You must log on before posting a comment.

If you don't have a username & password, please register now.




Top Viewed ArticlesView all articles
CES 2009: Ballmer Announces Windows 7, Windows Live, Live Search Milestones

During his first-ever Consumer Electronics Show (CES) 2009 keynote address last night in Las Vegas, Microsoft CEO Steve Ballmer announced the pending public availability of a feature-complete Windows 7, the final version of Windows Live Essentials, and ...

Command Prompt Tricks

One reader shares his tip for setting up the command prompt to reflect a remote path. ...

Where is Microsoft NetMeeting in Windows XP?

...


Related Articles Go Go Gadgets

Related Events Storage Consolidation for Your Microsoft Applications: Reducing Cost and Complexity

Optimize your VMware Infrastructure with the New Releases from the Symantec Backup Exec Family

Introduction to Identity Lifecycle Manager "2"

Check out our list of Free Email Newsletters!

Scripting eBooks Keeping Your Business Safe from Attack: Encryption and Certificate Services

Best Practices for Managing Linux and UNIX Servers

Building an Effective Reporting System

Related Scripting Resources Become a VIP member of the Windows IT Pro community!
Get it all with the VIP CD and VIP access. A $500+ value for only $279!

Subscribe to Windows IT Pro!
Solve your toughest technical problems with our experts and access 10,000 + articles online. 30% off

Monthly Online Pass - Only $5.95!
Get instant access to 10,000+ articles from Windows IT Pro Magazine!

TechNet Virtual Labs
Evaluate and test Microsoft's newest products.


Windows IT Pro Home Register FAQ for Windows WinInfo News
Europe Edition About Us Contact Us/Customer Service Media Kit Affiliates / Licensing  
SQL Server Magazine Office & SharePoint Pro Windows Dev Pro IT Job Hound ITTV
IT Library Technology Resource Directory Connected Home Windows Excavator Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 Copyright © 2009 Penton Media, Inc., All rights reserved. Terms and Use | Privacy Statement | Reprints and Licensing