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. . . .


basit601 October 01, 2008 (Article Rating: