[Editor's Note: Share your Windows 2000 and Windows NT discoveries, comments, problems, solutions, and experiences with products and reach out to other Windows 2000 Magazine readers (including Microsoft). Email your contributions (400 words or less) to r2r@win2000mag.com. Please include your phone number. We edit submissions for style, grammar, and length. If we print your submission, you'll get $100.]
Who's Hogging the Disk Space?
I administer a Windows NT Server 4.0 Web server running Microsoft IIS 4.0. I manage 70 Web-page maintainers, and each has an assigned folder to which the maintainer can upload Web pages. To keep an eye on the total size of these folders, I use the Microsoft Windows NT Server 4.0 Resource Kit Diruse tool. For example, all the maintainers' folders are in the G:\wwwroot\pagemaintainers directory. To find out the folders' size, I use the following syntax:
diruse /* /m /s /, g:\wwwroot\pagemaintainers > c:\spacehogs.txt
where /* shows the top-level folders, /m displays the folder size in megabytes, and /s includes the subfolders in the total. I run this command at a command prompt on the Web server.
I direct the command's output to a text file called spacehogs.txt. I can open this file in Microsoft Excel and arrange the results to my preference.
Craig R. Eckenrode
craig@eckenrodes.com
Logon Scripts Almost Work
With the advent of Windows Script Host (WSH), our organization decided to replace our logon command files with equivalent VBScript. Fundamental to any logon script is the ability to obtain the username of the user who is logging on. To our dismay, this feature failed to work in VBScript on our workstations. The first user to log on after booting received the error message 0x800704DD - Username not available when the system ran the script.
We realized that timing was the cause of this problem. The logon process executes in parallel to the script, so a problem arose when the script requested the username too early. As a solution, we set the script to loop until the username becomes available, as the following script example shows:
Set WshNetwork = WScript.CreateObject ("WScript.Network")
'Pause script until User is logged in
UserName = ""
On Error Resume Next
Do
UserName = WshNetwork.UserName
Loop Until UserName <> ""
On Error Goto 0
A. Marriott
ahlan@marriott.org
Backup Netscape Bookmarks
Several users at my company have lost their Netscape Navigator bookmarks as a result of machine crashes. I don't perform local backups of workstations, so I was stumped about how to back up just the bookmark.htm file without copying the entire Users folder.
I finally discovered a solutionuse the attrib command. I set the archive attribute for all files in the Netscape Users folder to off, and I set the attribute to on for the files that I wanted the system to back up (i.e., users' bookmarks). The batch file in Listing 1 runs as a logon script, so only 1 day's worth of changes to users' bookmarks is lost if their system crashes. You can apply the batch file to any set of files that you need to regularly back up, and set the copy location to your preference. I use the \profiles directory.
Mark J. Lucas
mjlucas@dar.caltech.edu