\[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 email@example.com. Please include your phone number. We edit submissions for style, grammar, and length. If we print your submission, you'll get $100.\]
Recover Administrator Passwords
I've seen many methods for recovering a forgotten administrator password on a Windows NT machine. However, most of the solutions are potentially destructive or unnecessarily complex. I've used the following easy-to-use solution on NT 4.0 machines, but I think it works on all NT versions.
First, shut down and reboot the machine so that you can gain access to the system's installation directory. You can use a DOS disk to access a FAT partition's installation directory and NTFSDOS to access an NTFS partition's installation directory. After you access the installation directory, rename logon.scr as logon.scr.back, then copy command.com to logon.scr. After you reboot the machine and wait about 15 minutes, the system will present you with a DOS prompt. At this point, you have full administrator access. Through the command prompt or User Manager, add a new administrator or change the administrator password, rename logon.scr.back to logon.scr, and close the DOS window.
Generate a Filename from the Current Date
To generate a filename derived from the current date, you can enable command extensions and use the For command and /f switch to parse the current date, which you use the date /t command to obtain. For example, the following command parses the current date into four tokens, which it delimits with a slash (/), hyphen (-), or a space:
for /f "tokens=1-4 delims=/- " %%i in ('date /t') do work.bat %%j-%%k-%%l
The first token is %%i, the second token is %%j, the third token is %%k, and the fourth token is %%l.
The format of the string that date /t returns is always numeric. However, the order of the day, month, and year, as well as the delimiter, depends on how you set the Short date style on the Date tab of the Control Panel Regional Settings applet. On my machines, the date /t command returns the date in the form Tue 14-09-1999 or Tue 14/09/1999. Thus, I need to specify three possible delimiters.
In the previous script, you can use any command following the do keyword. In my example, I call another batch file and pass to that batch file the current date that I rebuilt using hyphens as separators. You can use a date in the following format to rename an existing file:
for /f "tokens=1-4 delims=/- " %%i in ('date /t') do rename output.txt %%j-%%k-%%l.txt
Alternatively, you can use the date as a filename and pipe output directly to the new file, as follows:
for /f "tokens=1-4 delims=/- " %%i in ('date /t') do echo Hello >%%j-%%k-%%l.txt
Limitations of Autosave
In Letters to the Editor: "Undelete Utilities for Windows NT" (August 1999), Jonathan Cragle informed a reader that you can set an application (e.g., Microsoft Word, Excel, PowerPoint, Access) to autosave every 1 to 2 minutes. Jonathan didn't mention that the autosave feature in Microsoft products works only if the application terminates abnormally.
For example, when a user starts Word, the program automatically checks for any temporary files that the program previously autosaved. If no autosaved temporary files exist, Word opens to the default normal.dot template as Document 1. If an autosaved temporary file exists, Word asks the user whether he or she wants to resume working on that document.
When a user shuts down Word in a usual fashion (i.e., the user closes Word, the program asks whether the user wants to save changes, and the user responds No), Word deletes the temporary file so that a typical Word startup will occur the next time a user starts Word. If an event causes Word to shut down abnormally (i.e., the system loses power), the typical shutdown process doesn't take place. Therefore, Word autosaves the temporary file until the next Word session.
16-Bit Applications on NT
When I tried to run 16-bit applications on a Windows NT Workstation 4.0 machine, the system presented me with an error message that either said NT doesn't support 16-bit applications or that the application I was trying to run isn't an NT application. These error messages stumped me because I had previously run the applications on the system. Although I hadn't installed any new software that might have corrupted the Registry or the environment, the applications would run only if I updated the OS.
The generic answer on Microsoft's Web site is that the application's manufacturer needs to update or upgrade the software to make it NT-compatible. However, I knew this explanation wasn't the solution because the applications had previously run on this system.
To work around this bug, I used Systems Internals' Filemon utility. This utility let me determine which files the questionable applications had accessed (particularly the DLLs), copy those files from another workstation, and apply them to the appropriate directories on the troubled workstation. This process solved the problem. If you don't have another workstation available and you don't want to perform an update and reapply service packs, install the OS to another directory, apply the service packs, and copy the files from this alternative installation.
Unfair Microsoft Beta Exam Program
I've complained to Microsoft about the company's unfair treatment of Microsoft Certified Professional (MCP) beta exam participants, but the company has ignored me. Beta exam participants spend 3 hours providing Microsoft with test-answer data and pay Microsoft $50 to participate. In return, Microsoft rewards only those exam takers who pass the beta exams with a voucher for a regular test—a fact that the company discloses only in fine print. In addition to Microsoft luring exam participants with the false promise of vouchers, Microsoft doesn't compensate the participants for their time, the participants see only a portion of some exam questions, and Microsoft often throws out the questions they answer correctly, thus minimizing participants' value in taking the test.
To improve this situation, Microsoft needs to give all MCP beta exam takers a free exam voucher. In addition, the company needs to not only drop the $50 exam fee but also pay participants $100 for their time.
Adding a BDC to an Existing Domain
I recently bought a Windows NT Server 4.0 system to add as a BDC to the lone PDC on my NT network (i.e., I didn't have any BDCs or member servers). When I picked up the server from the MCSE who installed and configured NT, I asked him how to join the BDC to my existing domain. Although he outlined a procedure for me, I researched the topic before I proceeded. I'm glad I did.
I discovered the Microsoft article "Setting Up a Backup Domain Controller Stated Incorrectly" (http://support.microsoft.com/support/kb/articles/q126/6/40.asp), which explains that the only way an NT Server system can join a different domain is if you reinstall NT Server. In addition, the Microsoft article "Q&A: The Role of a Windows NT Server in a Domain" (http://support.microsoft.com/support/q126/4/36.asp) states, "A backup domain controller must be reinstalled in the new domain, but the \[member\] server can change its domain membership without reinstalling Windows NT." To attach my new BDC system to my existing domain, I reinstalled NT Server on the new system and connected it to my network and PDC.
Hide Domain Browse List Objects
I manage a pure Windows NT network. All the workstations in the network appeared in the Network Neighborhood domain browse list, and I wanted to hide all machines that weren't servers without disabling the Server service. To hide these unnecessary objects from the list, I added the following line to users' logon scripts:
net config server /hidden:yes
The list now shows only the servers I want to be public, and users can continue sharing their local resources.
Lock Down the Desktop
To implement desktop restrictions for all users on a domain server, edit the values of the Registry subkeys associated with Windows Explorer. Table 1 outlines the HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer subkeys that you can modify to lock down users' desktops.
Unattended Sound Card Installation
You might know that Windows NT 4.0 doesn't detect sound cards. However, are you aware that NT 4.0 doesn't let you create a Sysdiff image or specify sound card settings in an unattended installation file? If you're struggling with unattended sound card installation on NT 4.0 systems, try the following solution that I used to create an unattended installation of Voyetra Turtle Beach's Montego sound cards on Dell OptiPlex GX1 standard-platform PCs.
I used Microsoft's ScriptIt utility to create a simple and efficient solution that automatically installed the sound card drivers. To install ScriptIt, I inserted the TechNet CD-ROM labeled Server Utilities and copied scriptit.exe from the \winnt\tools directory. Next, I used a text editor to create an .ini file, which Listing 1 shows. This script installs Montego sound card drivers for English platforms. To automate the installation process, run the script through a batch file or an alternative software-automation engine (e.g., Seagate Software's WinINSTALL, Microsoft Systems Management Server—SMS—Installer).
Remote Printer Installation
This tip is for lazy Windows NT administrators. You don't have to be at a user's system to install a local printer driver. The following steps show you how to use your administrative account on your local workstation to perform this task.
- Open the Run dialog box.
- Enter \\computername or \\IPaddress of the remote machine, then click OK.
- The system will present you with a Windows Explorer window that shows shares on the remote machine. Double-click Printers.
- Click Add Printer.
- The system will present you with a Remote Print Server \\computername dialog box. Continue the printer driver installation as usual.
You can install drivers from your local disk or a network drive. You can even print a test page remotely if someone connects the printer to the computer for you.
You can use the same procedure to remotely install printer drivers on NT Server 4.0, Terminal Server Edition (WTS) systems. This method is much faster than logging on to the servers through the WTS client or the Citrix MetaFrame client.