Reader to Reader - October 1997
Share your NT discoveries, comments, problems, solutions, and experiences with products and reach out to other Windows NT Magazine readers (including Microsoft).
September 30, 1997
Tips for NT Administrators
[Editor's note: Share your NT discoveries, comments, experiences withproducts, problems, and solutions and reach out to other Windows NT Magazinereaders (including Microsoft). Email your contributions (under 400 words) toKaren Forster at [email protected]. Please include your phone number. Wewill edit submissions for style, grammar, and length. If we print your letter,you'll get $100.]
Has the following scenario happened to you? You log on to a user's WindowsNT machine to perform some administrative tasks. Then you log off. Next, you geta follow-up tech support call because the user tried to log on but couldn't. Theuser forgot to change the username back to the user's logon.
I wrote a little batch file, which you see in Listing 1, to take care ofthis problem. Put this batch file into a public, shared area. Note the usernamewhen you log on to the user's computer. After logging on, enter
SETUSER
from Program Manager, File Run in NT 3.51 (or Start, Run in NT 4.0). Thebatch file in Listing 1 changes the Registry entry pertaining to the lastlogged-on user.
Change the tmpfile to a local temporary file. Make sure regedit.exe is available in your path.
—Steve Hong
[email protected]
Windows NT Message of the Day
In UNIX, the message of the day is a standard option that you caneasily modify and present to all users. Windows NT lacks an apparent method forconstructing a message of the day that users can view. To address thisshortcoming, I created the C program in Listing 2, and some Registryedits that let NT display a message of the day to selected users. The programmsg.exe lets administrators present none, one, or two messages to auser. The messages appear on top of any open window, and the user must dismiss them.
The program is basic. The executable msg.exe resides in the system32directory. When a user logs on to the NT workstation, the winlogon Registryentry HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersionWinlogonUserinitexecutes msg.exe. The msg.exe program wakes up and checks themessage directory for two files: msg1.txt and msg2.txt. If msg1.txt exists, abell rings slowly five times and then a notice appears on the screen, displayingthe contents of the msg1.txt file. After the user dismisses the first message,msg.exe checks for the existence of a second file, msg2.txt, and displays itscontents. If either message file is missing, the msg.exe program bypasses thenotices.
To install this program, first decide where the message files will reside.Be sure the C file (ex. #define MESSAGE1 "c:\message\msg1.txt")reflects this information. Add the two message files to the appropriatedirectory. Compile the message program source, and put it in the system32directory where the logon program can find it. Edit the Registry values inHKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsNTCurrentVersionWinlogonUserinit. Change the entry
userinit,nddeagnt.exe
to
userinit,nddeagnt.exe,msg.exe
Notice that I added the msg.exe program to the end of the string. After theedit is successful, log off and log back on to the system and test for results.A notice box will appear with the contents of the text file msg1.txt.
After the user logs on to the NT workstation, the system beeps five timesand displays the first message of the day. After the user dismisses the firstnotice, the system beeps again and the second message appears. The programchecks for the existence of the message files, and if they are unavailable, theprogram does not invoke a message of the day, effectively turning off theservice.
—William A. Dodd
[email protected]
A UNIX Snob's Opinion of NT
I am a big fan of UNIX and am keeping a wary eye on the Windows NT platform.If you ask me which OS I prefer, I will tell you UNIX, without hesitation. But Ibelieve that competition is good for business, so I am enjoying the sight of thevarious UNIX vendors scrambling to lower prices and add features as NTencroaches on their turf.
I spend my day in front of a Silicon Graphics machine (which has one of thefinest desktops I've ever seen), and I spend most of my time navigating the UNIXenvironment from the command line. All my administrative tools have been builtfor this interface, so I can use them over a low bandwidth (even 300 baud) lineif necessary.
If I'm to take NT seriously as a server, I'll need to see something otherthan that awful DOS shell. I feel like I'm doing administration with a diaperon.
I understand Microsoft's marketing approach that NT is aneasy-to-administer server, but it can't be all things to all people. If I'm toseriously consider replacing the tried-and-true UNIX servers with NT servers,Microsoft will have to accommodate my need for more control over the OS from thecommand line. I'll give one example: edlin. If edit.com makes the OS crawl, whynot just add edlin? If you hate edlin, don't use it.
Adding low-tech and low-bandwidth intensive tools to the OS and providingmore standard scripting capabilities will eventually seduce us UNIX snobs over to the dark side. Thanks for a great magazine that is well worth itssubscription price.
—Kent Dahlgren
[email protected]
Corrections to this Article:
I noticed an error the the Reader to Reader listing, "C Program Listing for a Message of the Day." Three angle brackets are missing at the top three #include header files. The MS C++ compiler issues the "missing > error" and refuses to compile the program. When I add the angle brackets, the program compiled without error.Tai [email protected]
About the Author
You May Also Like