DOWNLOAD THE CODE:
Download the Code Listing_01.txt

Download the Code Listing_02.txt

Download the Code Listing_03.txt

Download the Code Listing_04.txt

Download the Code Listing_05.txt

Download the Code Listing_06.txt

Download the Code Listing_07.txt

 See correction to this article

Don't Let Old Files Lie
Internet Information Server (IIS) generates log files in the form INyymmdd.log. Because I use a monthly log schedule on my intranet server, IIS creates a new log file every month.

Although I use the current month's file for debugging and troubleshooting, the rest of the log files just take up space in the log directory. So I wrote a script that cleans out the log directory by deleting log files that are a certain number of months old. I use the AT command to schedule the script's execution.

To use this script, extract the batches in Listings 2, 3, and 4 into the same directory. After you change the hard-coded directories to match the values in your system, schedule the script to run with the AT command. For example, to run the script the first of every month, I use the command

AT 04:00 /Every:1 "cmd /c e:admin\iislogmanager_start.bat
>e:\admin\iislogmanager.log"

This script works with not only monthly, but also daily, logs. In addition, you can easily customize the script so that it manipulates logs in other ways. For example, you can adapt the script so that it archives old logs instead of deleting them. Because this script uses an Italian locale, you might need to adapt the script where it extracts the current date. REMs precede the affected line.

—Alessandro Iacopetti
a.iacopetti@cedacriovest.it

SP3 Needed for Full Color
I recently discovered information about Intel's Accelerated Graphics Port (AGP) and Windows NT. To get more than basic VGA (16 colors) out of your ATI@work AGP video adapter, you must install Service Pack 3 (SP3). Only then will the Rage Pro drivers work to give you the color depth you expect from a 4MB or 8MB adapter.

I've also discovered that if you install the ATI drivers without SP3 during setup, NT will offer a minimum of 256 colors at any resolution. In addition, clicking Test blacks the screen and locks up the machine. Until you install SP3, you must use basic VGA.

—J. D. Ray
jdray@sns-access.com

Modify the Boot File
Mirroring (or duplexing) your system and boot partitions is a great way to provide fault tolerance for your operating system (OS), but mirroring often causes inexperienced administrators to get confused when the primary drive fails. The system fails to reboot properly because the Advanced RISC Computing (ARC) path in the boot.ini file points to the failed partition.

The usual workaround for this problem is to use an alternative boot floppy that has the boot.ini pointing to the mirrored drive partition. But inexperienced administrators often don't prepare these floppies in advance. Plus, these floppies can get lost, erased, or mislabeled.

I have devised another workaround for this problem: I include the path to the mirrored partition in the boot.ini file. As Listing 5 shows, you can use Notepad or another text editor to add the ARC path of the mirrored drive and partition to the OS section of the standard boot.ini file. This alternative drive must have a master boot record from a previous Windows NT installation to work.

Now if the primary drive fails, you'll have 30 seconds to choose the Mirrored Boot after restarting the server. You'll still have to replace the failed drive and reestablish the mirror as soon as possible, but at least you can quickly and easily get your system running.

Same Theory, Different Procedure for Automation
After reading Dmitrii Lezine's "Automate for Easy Installation" in December 1997 Reader to Reader, I found myself wondering if the same procedure would work for an out-of-the-box Digital Equipment PC preloaded with Windows NT Workstation 4.0. I found that the theory is sound, but the procedure is different.

Digital uses the file c:\winnt\system32\$winnt$.inf for its installation settings. With the help of NT's Setup Manager (in the Microsoft Windows NT Workstation 4.0 Resource Kit) and Guide to Automating Setup (at http://www.microsoft.com/ntworkstation/info/deployguide.htm), I modified the file to fit my needs (as Listing 6 shows).

A coworker and I then created a batch file that replaced the original $winnt$.inf with the modified $winnt$.inf file and appended the computer-name parameter to the end of the file. Listing 7 contains this batch file, which I put on a bootable disk.

I booted off the disk, typed

SETUP WKSTN_1

ejected the disk, and restarted the machine. When the machine booted into setup mode, I agreed to the Licensing Agreement and walked away. When I returned, the machine was completely setup with the correct protocols. It had even created a computer account for itself in the domain. All I had to do was log on.

Remove Your NT Server from the Browser Election
If you use a Windows NT server for research and development and you're rebuilding it often, consider installing that server as a standalone. Here's why: When your NT server is a Primary Domain Controller (PDC) or Backup Domain Controller (BDC), it participates in a browser election each time you bring the server back online. If you continually take your server offline and then bring it back online, the server and clients can get an empty browser list. If you install the NT server as a standalone, however, that server will not be a part of the browser election. Your network will then run smoothly.

End of Article

Prev. page     1 [2]     next page -->
CORRECTIONS TO THIS ARTICLE:
Listing 2 in Reader to Reader: "Don't Let Old Files Lie" contained the following incorrect statement: set SHORTDATE=%DATE: 12,2%%DATE: 7,2% The correct syntax is set SHORTDATE=%DATE:~12,2%%DATE:~7,2%




You must log on before posting a comment.

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

Reader Comments

I read the short article in May’s Reader to Reader about the use of a Jaton Video Card with a Trident 9685 chipset. The article stated that the card and driver set are not Windows NT compatible. Although the chipset is not listed on Microsoft’s Hardware Compatibility List (HCL), I have successfully used this card on several NT 4.0 systems during the past few months. Many products on the market that Microsoft has not tested and certified will work with NT 4.0 (e.g., the Diamond Viper 330 PCI video card on the machine I’m using to write this letter). The only warning in using untested hardware is that you might run into problems that force you to be more savvy than the average person to get the hardware to work successfully. Supplying a third-party driver set for NT but not having the card tested is a classic sign of this type of product. I think the magazine is remiss to print items without doing appropriate research. A lot of people (especially home hobbyists) believe everything they read and consider themselves extremely savvy in areas like hardware setup when they really aren’t.<br> --John Luce<br><br>

<i>Thank you for your letter. We appreciate readers who set the record straight or fill in the gaps to provide a complete picture. We research everything that appears in the magazine. In the Reader to Reader article you refer to, the reader was relating his particular experience with a video card. As you point out, users might run into problems, and this user did.<br> --Karen Forster</i>

John Luce

 
 

ADS BY GOOGLE