Windows IT Pro is the leading independent community for IT professionals deploying Microsoft Windows server and client applications and technologies.
  
  
  Advanced Search 


November 1997

Reader to Reader - November 1997

RSS
Subscribe to Windows IT Pro | See More Directory Services Articles Here | Reprints | Or get the Monthly Online Pass—only $5.95 a month!

Download the Code Here
Download the Code Here
Download the Code Here
Download the Code Here

[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.


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.

   Previous  [1]  2  Next 


Top Viewed ArticlesView all articles
Microsoft, News Corp. Discuss Locking Out Google

Microsoft and Rupert Murdoch's News Corp. recently discussed an alliance that would counter Google's fledgling online news service. ...

2009 Windows IT Pro Editors' Best and Community Choice Awards

Picking a favorite product from an impressive crowd of competitive offerings is never an easy task, and such was the case with our Editors' Best and Community Choice awards this year. ...

Command Prompt Tricks

One reader shares his tip for setting up the command prompt to reflect a remote path. ...


Task Automation Whitepapers From Development to Production: Streamlining SharePoint Deployment with DocAve Deployment Manager

Related Events Deep Dive into Windows Server 2008 R2 presented by John Savill

Managing Systems Efficiently in a Mid-Sized Business

Check out our list of Free Email Newsletters!

Task Automation eBooks Spam Fighting and Email Security for the 21st Century

A Guide to Windows Certification and Public Keys

Keeping Your Business Safe from Attack: Patch Management

Related Task Automation Resources Introducing Left-Brain.com, the online IT bookstore
Looking for books, CDs, toolkits, eBooks? Prime your mind at Left-Brain.com

Discover Windows IT Pro eLearning Series!
Clear & detailed technical information and helpful how-to's, all in our trademark no-nonsense format


Windows IT Pro Home Register FAQ for Windows WinInfo News
Europe Edition About Us Contact Us/Customer Service Media Kit Affiliates / Licensing  
SQL Server Magazine Office & SharePoint Pro DevProConnections IT Job Hound
Left-Brain.com Technology Resource Directory asp.netPRO ITTV Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 © 2009 Penton Media, Inc. Terms of Use | Privacy Statement