[Editor's note: Share your NT discoveries, comments, experiences with
products, problems, and solutions and reach out to other Windows NT Magazine readers (including Microsoft). Email your contributions (under 400 words) to Karen Forster at karen@winntmag.com. Please include your phone number. We will edit submissions for style, grammar, and length. If we print your letter, you'll get $100.]
I use the command prompt for many admin tasks in NT. However, instead of
opening a prompt and repeatedly using the CD command, I use the SendTo folder to
open the command prompt to the same directory as a given Explorer folder.
Create a batch file (.bat or .cmd extension), such as newcmd.cmd in your
Winnt folder (or another folder in the path), with the following contents:
@echo off
prompt $p$s$+$m$s$g
color 0a
title "CMD Started at %1 from batch %0"
start /D%1 /B
Right-click Start and choose Explore to open your profile folder. Find and
open the SendTo folder. Create a shortcut to the newcmd.cmd batch file in the
SendTo folder. You can test this batch file by opening Explorer, right-clicking
any folder, and choosing NEWCMD in the SendTo menu.
The START command's /B switch inherits the environment from the prompt,
color, and title commands in the batch file. START generates a command prompt by
default if you don't specify another .exe to run, opening the new command in the
directory that the /D switch identifies. The /D switch gets its path from the
first argument you enter after the batch file name--in this case, the folder
piped in when you select from the SendTo menu.
Note that the START command has a switch to set the title of any new
command prompt. But if you want to inherit the environment from the starting
batch file, you must set the title before the start command, as shown in the
example.
Someone at Microsoft must be listening, because NT 4.0's cmd.exe is greatly
improved over previous versions. Enter
<command> /?
at the prompt to get more information about commands such as FOR, PROMPT,
IF, CALL, COLOR, and TITLE.
Rick Cogley, rcogley@ptstrain.co.jp
Make SMS Utilities More Administrator Friendly
Systems Management Server's (SMS's) CD-ROM has two command-line utilities
that can help administrators troubleshoot package distribution and send status.
The first utility, pcmdump.exe, lets administrators view the instruction file
(.ins) in the site server (SMS\SITE.SRV\MAINCFG.BOX\PCMDOM.BOX\domain.000\smsid.INS)
and in the logon server (SMS\LOGON.SRV\PCMINS.BOX\smsid.INS). The second utility,
dumpsend.exe, lets administrators view the
send request and status file in the site server (SMS\SITE.SRV\SENDER.BOX\REQUEST\sender.000\*.SRQ
and *.SRS).
As you can see from the utilities' paths, you must type a lot of characters
to get these files. Hypothetically, if you type slowly enough, a file can
disappear before you get to the directory because the system dynamically
modifies files. In addition, the command's output usually fills more than one
screen, so you need to modify the property of the command prompt and scroll back
and forth.