Admin Tip #294: Windows NT Resource Kit Utilities useful in batch files |
Hits: Failed to execute CGI : Win32 Error Code = 3
|
The Windows NT Resource Kit has a set of utilities which supplement batch file capabilities. AutoExNT lets you start the NT command autoexnt.bat upon boot. AutoExNT runs as a service and thus does not depend on anyone logging in to execute.
As an ex-unix admin, I am used to powerful command-line utilities. addusers lets you add and delete local or remote accounts from the command-line.
If you use logon scripts, ifmember lets you perform operations depending on user group membership.
Logevent allows you to write records into Windows NT application event log.
DumpEVT exports event logs into format suitable for importing into a database or for automated processing.
Robocopy is an enhanced xcopy which can copy a single file or entire directory trees and it will retry if there are network errors.
Choice is useful for writing batch scripts with choices such as:
choice Enter Y to run now or N to cancel.
now lets you capture the current time into log files via redirection:
now Start myscript >> myscript.log
...
now End myscript >> myscript.log
I used the sleep command in unix shell scripts to wait a certain number of seconds and then continue. Its useful in batch files to display some text, wait x seconds ( sleep ), and then continue. Windows NT Resource Kit Supplement 4 adds the Timeout command which operates like sleep. Unlike sleep, if you press a key, the timeout period ends immediately. Nice.
Microsoft has a long way to go before it provides command-line utilities of the power available to unix. You may have noticed my focus on freeware, shareware and commercial utilities command-line utilities. Administrators with unix backgrounds realize how inadequate the gui tools Microsoft supplies are in real enterprise environments. I hope to use this site to help inform you of tools to aid fill this lack. I personally have used the MKS Toolkit to fillout the lack. See Comparison of NT commandline vs Linux commandline for more information.
Tim Hill's text on command line scripting is outstanding. If you have an extensive background, writing bat files, forget it. Otherwise, get it.