Platinum Edition Using Windows NT Server 4

Previous chapterNext chapterContents


Appendix B

Tips for Using NT Server

The tips you find in this appendix will help you customize NT's desktop and make it easier to use. Many of these tips involve changing the Registry. See the chapters in Part VIII, "Working with the Registry," to learn how to do this safely.

You can find a variety of other useful tips on the Internet. Go to InfoSeek (http://www.infoseek.com) and use the search phrase Windows NT Server 4.0 +tips. Infoseek returns a large list of Web sites dedicated to providing a variety of tips. One of the best tip sites I've found is at JSI Inc. (http://www.jsiinc.com/reghack.htm); it contains more than 200 useful tips for Windows NT.

Adding Actions to the Context Menus

If you have more than one program that accesses the same type of file, you'll want to add an action to the file extension's context menu that enables you to choose between both programs. This gives you two options for opening a file: Open with program A and open with program B, for example.

Why is this useful? Take a look at DOC files. When you install Windows, it associates WordPad with DOC files. WordPad is a fast editor that is file-compatible with Microsoft Word. The trouble begins when you install Microsoft Word. Word associates DOC files with itself--leaving you without a convenient way to open a DOC file in WordPad.

Fortunately, you can add a new action to the DOC file's context menu that enables you to open DOC files with WordPad, too. Just follow these steps:

1. Open the Registry Editor and find HKEY_CLASSES_ROOT\Word.Document.6\shell.

2. Add the subkey \Open with Wordpad, and add the subkey \command under \Open with Wordpad so that you've added the new branch \Open with Wordpad\command.

3. Set the default value entry for \Open with Wordpad\command to C:\Program Files\Accessories\WordPad.exe "%1".

4. Close the Registry Editor.


NOTE: The quotation marks around the %1 in the command line tell Windows NT to put the file name inside quotation marks. It's frequently called a placeholder. If you don't put "%1" in the command line and you select a long file name with spaces in it, WordPad won't be able to open the file.

Now you can open DOC files with either Microsoft Word or WordPad. Double-click a DOC file to open it in Word. Right-click a DOC file and choose Open With WordPad to open it in WordPad.


TIP: You can change the hotkey of an action by prefixing an ampersand (&) to the hotkey. For example, Open with &WordPad causes W to be the hotkey.

Adding Environment Variables to the NT Registry

Environment variables enable you to specify settings for other programs to use. You're probably accustomed to using them in your AUTOEXEC.BAT file. The TEMP and TMP environment variables are pretty typical, for example. These contain paths that tell Windows and all other programs where to store temporary files.

You don't have to put your environment variables in AUTOEXEC.BAT. You can add them to the Windows NT Registry, in HKEY_CURRENT_USER\Environment. Each value entry corresponds to a single environment variable. The name of the value entry is the name of the environment variable, and its string content represents the environment variable's value. You can add a subkey named HKEY_CURRENT_USER\Environment\TEMP and set its value to C:\TEMP to have all Windows NT programs store their temporary files in C:\TEMP, for example.


TIP: You can also add environment variables by using Windows NT's System icon in Control Panel.

Automatically Logging On to NT Workstation

Do you ever tire of typing your username and password every time you start Windows NT? You can tell Windows NT to automatically log you on.


CAUTION: Is your Windows NT 4.0 computer connected to a network? If so, think twice before customizing Windows NT, as described in this section. Customizing Windows NT so that it automatically logs you on can cause a serious security hole in the network, which your network administrator will not like.

To have Windows NT automatically log you on:

1. Open the Registry Editor and find HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon.

2. Add a new string value entry named AutoAdminLogon, and set its value to 1.

3. Add a new string value entry named DefaultPassword, and set its value to the password of the user shown in DefaultUserName.

4. Close the Registry Editor.

Changing Internet Explorer's Default Protocol

If you type an URL in Internet Explorer's toolbar, it automatically supplies the prefix with the appropriate protocol. If you type www.microsoft.com, for example, Internet Explorer changes it to http://www.microsoft.com. If you type ftp.microsoft.com, Internet Explorer changes it to ftp://ftp.microsoft.com. Notice that it chooses the protocol based upon how the URL begins.

But what happens when you type rampages.onramp.net/~jerry? By default, Internet Explorer assumes that it's a Web page and adds http:// to the beginning of it. If this isn't the behavior you want, you can specify a different prefix by following these steps:

1. Open the Registry Editor and find HKEY_LOCAL_MACHINE\SOFTWARE\ Microsoft\Windows\CurrentVersion\URL\DefaultPrefix.

2. Change the default value entry to the prefix you want Internet Explorer to use if it can't figure out what type of address you typed--for example, ftp://.

3. Close the Registry Editor.

Changing the Desktop Icons

You're not stuck with the icons or names that NT uses for the special desktop icons (My Computer, Recycle Bin, and so on). You can change them all:

1. Open the Registry Editor and find HKEY_CLASSES_ROOT\CLSID.

2. Look up the icon you want to change in the following table. Then find the subkey for the icon under HKEY_CLASSES_ROOT\CLSID.
Icon Name Subkey
Briefcase {85BBD920-42A0-1069-A2E4-08002B30309D}
Control Panel {21EC2020-3AEA-1069-A2DD-08002B30309D}
Dial-Up Networking {992CFFA0-F557-101A-88EC-00DD010CCC48}
Inbox {00020D75-0000-0000-C000-000000000046}
My Computer {20D04FE0-3AEA-1069-A2D8-08002B30309D}
Network Neighborhood {208D2C60-3AEA-1069-A2D7-08002B30309D}
Printers {2227A280-3AEA-1069-A2DE-08002B30309D}
Recycle Bin {645FF040-5081-101B-9F08-00AA002F954E}
The Internet {FBF23B42-E3F0-101B-8488-00AA003E56F8}
The Microsoft Network {00028B00-0000-0000-C000-000000000046}

3. Change the default value entry to the name that you want displayed on the desktop. For example, change Recycle Bin to Garbage.

4. Open the DefaultIcon subkey and change the default value entry to the path of the icon file and the index of the icon. If you want to use the fourth icon (0, 1, 2, 3) in SHELL32.DLL, for example, type C:\WINDOWS\SYSTEM\SHELL32.DLL,3. You can get icons from DLL, EXE, ICO, and other files.

5. Close the Registry Editor.


NOTE: Most EXE and DLL files have icons in them. Some DLLs have many useful icons-- MORICONS.DLL, COOL.DLL, PIFMGR.DLL, PROGMAN.DLL, and SHELL32.DLL. Look in C:\WINNT, C:\WINNT\System, and C:\WINNT\System32 for these and other files that contain useful icons. To see the icons contained in a file, you can use one of the many shareware icon extractors that you can download on the Internet, or you can view these icons in Explorer's Options dialog box.

Changing the NT Logon Screen's Bitmap

The bitmap that Windows NT displays during the Ctrl+Alt+Del logon screen is sharp, but you might want to display your company logo or a family portrait instead. You can change this bitmap in the Registry by following these steps:

1. Open the Registry Editor and find HKEY_LOCAL_MACHINE\.DEFAULT\Control Panel\Desktop.

2. Change the Wallpaper string value entry so that it contains the path and file name of the bitmap that you want to display on the logon screen.

3. Close the Registry Editor.

Changing the Location of System Folders

Have you ever tried to move the \ShellNew folder to a new location? How about Microsoft Word's \My Documents folder? You can't move them unless you do it through the Registry. Try deleting the \Recent folder from the Windows folder. You can't do it because Windows keeps a list of shell folders in the Registry. This is how it knows where to find things such as your Start menu, desktop shortcuts, and recent documents.

You'll find these shell folders at HKEY_CURRENT_USER\SOFTWARE\Microsoft\ Windows\CurrentVersion\Explorer\Shell Folders. Table B.1 shows you the value entries you'll find by default in Windows NT. Note that, in Windows NT, most entries point to C:\WINNT\Profiles. Each user that logs on to the workstation has his or her own folder under this path. My desktop would be stored in C:\WINNT\Profiles\Jerry, for example. In Table B.1, notice that I've used a placeholder for the user's name that looks like Username. Substitute your own username. I've also included the entries that Microsoft Office adds.

Table B.1 Default Shell Folders in Windows NT

Value Entry Default
AppData C:\WINNT\Profiles\Username\Application Data
Common Desktop C:\WINNT\Profiles\All Users\Desktop
Common Programs C:\WINNT\Profiles\All Users\Start Menu\Programs
Common Start Menu C:\WINNT\Profiles\All Users\Start Menu
Desktop C:\WINNT\profiles\Username\Desktop
Favorites C:\WINNT\Profiles\Username\Favorites
Fonts C:\WINNT\Fonts
NetHood C:\WINNT\Profiles\Username\NetHood
Personal C:\WINNT\Profiles\Username\Personal
PrintHood C:\WINNT\Profiles\Username\PrintHood
Programs C:\WINNT\Profiles\Username\Start Menu\Programs
Recent C:\WINNT\Profiles\Username\Recent
SendTo C:\WINNT\Profiles\Username\Sendto
Start Menu C:\WINNT\Profiles\Username\Start Menu
Startup C:\WINNT\Profiles\Username\Start Menu\Programs\Startup\
Templates C:\WINNT\Profiles\Username\ShellNew

Disable AutoPlay for the Server's CD-ROM

To prevent CDs from playing automatically when you insert them into the server's CD-ROM drive:

1. Open the Registry Editor and find HKEY_LOCAL_MACHINE\SYSTEM\ CurrentControlSet\Services\Cdrom.

2. Change the value entry named Autorun to 0.

3. Close the Registry Editor.

Displaying a Custom Message During NT Logon

If your organization has certain policies that you want your users to know about, you can have Windows NT display those policies in a text box that users have to confirm when they log on to the workstation. You might want all your users to acknowledge an "acceptable usage policy," for example, that precludes them from visiting certain Web sites on the Internet. The users can't log on to the workstation without acknowledging that they've read and understood the message.

To set both the caption for the text box and the message that Windows NT displays in the text box:

1. Open the Registry Editor and find HKEY_LOCAL_MACHINE\SOFTWARE\ Microsoft\Windows NT\CurrentVersion\Winlogon.

2. Add a new string value entry named LegalNoticeCaption, if it doesn't exist, and set its value to the string of characters you want Windows NT to display in the title bar of the text box.

3. Add a new string value entry named LegalNoticeText, if it doesn't exist, and set its value to the string of characters you want Windows NT to display in the body of the text box.

4. Close the Registry Editor.

Expanding Your Icon Cache

The icons that Windows displays in the folder view, Start menu, and Explorer are stored in the file named C:\WINNT\ShellIconCache. Doing so speeds up the process of displaying icons for files because they can be grabbed out of the cache, instead of loaded from the programs responsible for the icons.

The icon cache is limited to 512 icons. If you fill up the cache, it's destroyed and re-created from scratch. When this happens, notice that your desktop clears, and Windows redraws each of the icons, which is really annoying.

You can raise the limit from 512 icons to a much larger number by doing the following:

1. Open the Registry Editor and find HKEY_LOCAL_MACHINE\SOFTWARE\ Microsoft\Windows\CurrentVersion\Explorer.

2. Add a new string value entry named Max Cached Icons, and set its value to 4000.

3. Close the Registry Editor.

Ignoring Changes to Your Desktop

Each time you shut down Windows, it remembers the position of all the desktop icons, the taskbar, and any open Explorer windows. If you put Explorer in your Startup program menu and forget to close Explorer before shutting down Windows, you'll have two copies of Explorer on your desktop when you restart Windows--the copy you loaded in the Startup program menu and the copy that you left on your desktop when you shut down Windows.

If you want Windows' memory to be a bit less permanent, follow these steps:

1. Arrange your desktop just the way you want it and restart your computer.

2. Open the Registry Editor and find HKEY_CURRENT_USER\SOFTWARE\Microsoft\ Windows\CurrentVersion\Policies\Explorer.

3. Set the value of NoSaveSettings to 1. (If you don't see a value entry named NoSaveSettings, add it.)

4. Close the Registry Editor.

Now your desktop will look the same every time you start Windows--even if you've messed around with it. Also, if you put Explorer in your Startup group and forget to close it before you restart Windows, you won't have two copies of Explorer running after Windows restarts.

Nuking the Annoying Windows Animation

When you minimize, maximize, or restore a window, Windows uses animation to show you where it's going. If you have a slow computer, the animation can rob you of that crisp feeling you get when a window pops open or disappears from the screen. Here's how you can turn off the window animation:

1. Open the Registry Editor and find HKEY_CURRENT_USER\Control Panel\Desktop\WindowMetrics.

2. Change the value entry named MinAnimate to 0.

3. Close the Registry Editor. This change won't take effect until you restart your computer.

Launch a Batch Job without Logging on to the Server

You can execute a batch job without actually logging on to the server. To do so, you need to launch it as a service. The Windows NT Server Resource Kit comes with a utility named SRVANY that will launch any application as a service, prior to logging on to the server. You find it in the \CONFIG folder underneath the folder for your platform. You find the documentation for SRVANY in \COMMON\CONFIG\SRVANY.WRI.

Launching Explorer from My Computer

There are many different ways to get to Explorer. You can launch it from the Start menu. You can right-click My Computer and choose Explore. You can even double-click My Computer while you hold down the Shift key. So why can't you launch Explorer just by double-clicking My Computer? Well, you can. Here's how to set it up:

1. Open the Registry Editor and find HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\Shell.

2. Set the default value entry for this key to explore.

3. Add the subkey \explore, and add the subkey \command under \explore so that you've added the branch named \explore\command.

4. Set the default value entry for your new \explore\command branch to explorer.exe.

5. Close the Registry Editor.

Now when you double-click My Computer, Windows loads Explorer instead of opening the folder view.


NOTE: You'll have two entries in My Computer's context menu that say Explore, but this isn't harmful. The first entry is an action that Windows puts in My Computer's context menu--you won't find it in the Registry, and you can't get rid of it. The second entry is the one you added in the previous steps.

Locating Windows NT's Registry Hives

Windows NT stores the location of each Registry hive in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\hivelist. Here are the hives you'll find by default:

\REGISTRY\MACHINE\HARDWARE

\REGISTRY\MACHINE\SECURITY

\REGISTRY\MACHINE\SOFTWARE

\REGISTRY\MACHINE\SYSTEM

\REGISTRY\USER\.DEFAULT

\REGISTRY\MACHINE\SAM

\REGISTRY\USER\SID_#

Making Control Panel More Accessible

When you choose Settings, Control Panel from the Start menu, Windows opens a folder with all the Control Panel icons. But what if you don't want a folder? Wouldn't it be better if you could open a submenu on your Start menu that contains all the Control Panel icons? You can, and here's how:

1. Right-click the Start button and choose Open.

2. Create a new folder and rename it as:

Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}

Now when you choose Control Panel from the Start menu, it opens another submenu rather than a folder.


NOTE: In reality, you can type anything you want before the period. Make sure that you type everything after the period exactly as shown in Step 2, however. If you type the wrong number, you'll see a regular folder icon in the Start menu instead of the Control Panel icon.

You're not limited to using this method only for Control Panel. You can add any of the icons described in the following list to the Start menu (other icons, such as The Microsoft Network, are very useful). Replace the name in Step 2 with one of the names from the following list of folder names:

Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}

Dial-Up Networking.{992CFFA0-F557-101A-88EC-00DD010CCC48}

Printers.{2227A280-3AEA-1069-A2DE-08002B30309D}

Recycle Bin.{645FF040-5081-101B-9F08-00AA002F954E}

Making the Start Menu Snappier

Have you ever noticed the slight delay when you choose a submenu on the Start menu? Many folks think this is annoying. You can eliminate the delay by performing these steps:

1. Open the Registry Editor and find HKEY_CURRENT_USER\Control Panel\Desktop.

2. Change the value of MenuShowDelay to a smaller number (the default is 400) to make the menus open faster. You can even set this value entry to 0. Note that you might have to add this string value entry to the subkey.

3. Close the Registry Editor. This change won't take effect until you restart Windows NT.

Prevent NT from Displaying the Last User Logged On

By default, Windows NT displays the name of the user who last logged on in the Logon Information dialog box. You can prevent this:

1. Open the Registry Editor and find HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon.

2. Change the value of DontDisplayLastUserName to 0.

3. Close the Registry Editor.

Schedule a Backup by Using the AT Scheduling Service

You can use NT's built-in scheduling service to schedule the NT Backup utility. You must define a user account with the privileges necessary to perform a backup--it must be a member of the Administrators group and have the right to log on as server. To schedule the backup:

1. In the Services dialog box, select the Schedule service, click Startup, and fill in the name of the account you created.

2. Start and restart the service.

3. Create a batch file named BACKUP.CMD that has the necessary command line to launch NTBACKUP.EXE. For example: C:\WinNT\system32\ntbackup backup c: /D "Daily Backup" /B /L "c:\Daily.log". See NTBACKUP's help file for more information about using its command line.

4. Schedule the backup by using the AT scheduler. Type AT /? at the DOS prompt to see how to specify a schedule. The following example schedules BACKUP.CMD to execute every day at 2 A.M.:

AT 2:00 /every:M,T,W,TH,F "Drive:\Directory\BACKUP.CMD"

Refreshing Your Desktop Automatically

When you add a new folder or file to an existing folder, you sometimes have to refresh Explorer to see the changes. To make Explorer and your desktop refresh themselves when there's a change, follow these steps:

1. Open the Registry Editor and find HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Update.

2. Change the UpdateMode value entry to 00.

3. Close the Registry Editor. This change won't take effect until you restart Windows.

Running a Control Panel Application from the Start Menu

You can launch any Control Panel application by using a shortcut, which you can add to your Start button. Here's how:

1. Associate the CPL file extension with %windir%\system32\control.exe.

2. Create a shortcut to the application's CPL and store it on the Start menu or anywhere else on the server.

3. Launch the shortcut to start the Control Panel application.

Using a Bitmap's Image for Its Icon

If you have a large collection of bitmaps, you might have to open many pictures before you find the image you're looking for. Windows enables you to use the bitmap's actual image as its icon. To do so, follow these steps:

1. Open the Registry Editor and find HKEY_CLASSES_ROOT\Paint.Picture\DefaultIcon.

2. Change the default value entry to %1.

3. Close the Registry Editor.


TIP: The icons are easier to see if you choose View, Large Icons from Explorer's main menu.

It takes much longer to display a list of bitmaps in an Explorer window because each bitmap has to be rendered into an icon. After the bitmap loads for the first time, however, it will load much faster because these icons are cached. If you find that Windows is redrawing all your icons frequently, see "Expanding Your Icon Cache," earlier in this appendix, to learn how to stop it.

Using Different Icons for Folders

If you don't like the icon that Explorer uses for a folder, you can change it:


1. Open the Registry Editor and find HKEY_CLASSES_ROOT\Folder\DefaultIcon.

2. Change the default value entry to the path of the icon file and the index of the icon. If you want to use the fourth icon (0, 1, 2, 3) in SHELL32.DLL, for example, type C:\WINDOWS\SYSTEM\SHELL32.DLL,3. You can get icons from DLL, EXE, ICO, and other files.

3. Close the Registry Editor.

Viewing Unknown File Types

Have you ever right-clicked CONFIG.SYS, hoping to open it in Notepad, only to find the Open With menu option? SYS files are registered as system files and have no commands associated with them. There are plenty of other files that have no commands associated with them that would be useful to open in Notepad. You can remedy this situation, however, by associating Notepad with all unknown file types. Then the next time you right-click CONFIG.SYS (or any other unregistered file type), you see Notepad on the context menu. Just follow these steps:

1. Open the Registry Editor and find HKEY_CLASSES_ROOT\Unknown\Shell.

2. Add the subkey \Notepad, and add the subkey \command under \Notepad so that you've added the new branch \Notepad\command.

3. Set the default value entry for \Notepad\command to C:\WINDOWS\Notepad. exe "%1".

4. Close the Registry Editor.


Previous chapterNext chapterContents


Macmillan Computer Publishing USA

© Copyright, Macmillan Computer Publishing. All rights reserved.