----^--->
/\

//\\
//The\
/Sy
stem\
////
Guard
\

In the mount of the LORD it shall be seen. Genesis 22:14

 


Booming
or
Fuming?

Are You Alive?

Or Are You Fading Away?!

/\
//\\
//The\
/Sy
stem\
////
Guard
\

There is nothing that will stand without a Sure Foundation.  Although it seems easy to write a quick script in great haste with no documentation to solve today's urgent problem...it becomes a horrifying mess later when you (or someone else) have to reap that nightmare code which you have sown!

Joe Fumer suddenly cries out,

"I just can't see why I need to spend the time!  It's ONLY a little batch file!!"

"Well..., Joe...

Remember that quick backup script that you thought was working but it turned out that only changed files were being copied each night?!

A Sure Foundation would have shined the light on that problem the first day!"

"OK.  Tell me more."

If you're stuck in the Pit of Pity, wasting your precious time slugging through the Crater of Confusion...

DO SOMETHING ABOUT IT!

The confidence and reliability that we have built with our Command Library has opened a new world for Windows System Administrators.  It is no longer necessary to write a confusing mess of tangled code.  The resources in the Library allow self-documenting shell scripts that really work!

One brick at a time, we are building a Tower of Knowledge for writing .bat/.cmd files.  A comprehensive Single File Solution , filled to the brim with answers for the most grievous tribulations that face the Windows Admin each day, while still  retaining the look and feel of a simple batch file.  And we're doing it without third party utilities of any kind!

You only need one file---NTCmdLib.cmd!

So leave that old darkness of confusion at the foot of Mount Knowledge and follow the Path of Understanding to the TOP, where clearness reigns!

*******

Since you have previously registered with us, we welcome you as a member of /\TheSystemGuard/\.  This entitles you to early sightings of our newest treasures.  There's been a Flying Rumor going around about Big Things coming, and we can now confirm that it's true!  There ARE new Advanced and Expert Libraries coming!  Here's a taste of what we have prepared!

The shining star of our Command Library is the "Mounted Command", or Mt/\Cmd for short.  This is a section of Reliable, Cross-Platform Scripting Code that has been optimized and compressed into a single line.  Then, this little jewel is saved to an environment variable for instant access.  The variable is named to "sound like what it does" so when you use it in your script, the script becomes self-documenting!

For example, the code for the command .GetFree is stored in the variable %.GetFree%.  This command retrieves the free space of the current disk drive, displays it to the console, and saves the value to variable %#Free%.

One of our biggest challenges in constructing these commands is that there was not an easy way to specify parameters.  The object of the command's actions had to be determined by one of three methods.

1.  Prefixing the arguments before the Mt/\Cmd

COPY Source Destination %.Silent%

2.  Appending the arguments after the Mt/\Cmd

%.TimeEcho% Job started on Server1

3.  Implying the argument based on some known parameter of the console window at the time of execution.  For example, .GetFree reports on the current drive.

CD /D C:\
%.GetFree%

*******

When the required task had to "parse" a parameter, we always needed multiple lines of code and had to implement the next best thing: a $FUNCTION within the Command Library.  You still call the $FUNCTION with a one line command

%.Call% $FUNCTION Parm1 Parm2 [...]

But a trip to the disk drive, and through the Command Library was required, which is slightly slower than our cached Mt/\Cmd code.

But what if we could change the parameters anywhere inside a command, while still having the code "preloaded" and instantly available?!  Well--now we can!!  The answer is the Twin^^Peaks MountCommand, or M^^C for short.

And it's a major leap over the wall!

In essence, this is a two-step command.

Step 1: Load the input variable with one or more parameters

Step 2: Execute the M^^C while dynamically expanding the input variable from Step 1.

For CONSISTENCY, the input variable name is always the same as the Twin^^Peaks command name, without the "." prefix.  Let's look at an example.

*******

A frequent SysAdmin need is to check the accessibility of a remote system by using the native Ping utility.  A new M^^C called .Alive provides a CONSISTENT self-documenting method to check one machine, a list of machines or an entire range of IP addresses.

The variable which contains the input is called, of course, %Alive%.  The scripting code is stored in variable %.Alive%.  Since the input is expanded at runtime, you can set the input value and run the command within the same line of code!  Delayed Variable Expansion is not necessary, allowing full compatibility across NT/2K/XP/K3.  The self-documenting code looks like this:

NT
2K

XP
K3
FOR /L %%A IN (1,1,254) DO @(
   (SET "Alive=10.7.7.%%A")
  
(%.Alive%)
)

.Alive takes the internal Ping command up on Mount Knowledge!  The code above will check the entire address range from 10.7.7.1 through 10.7.7.254, reporting on each address in turn.  But it get even better than that!

Success is reported to STDOUT, failure is reported to STDERR.  So, to see only the addresses that are active, suppress STDERR using the %.Kity% {Keep-It-To-Yourself] command.

NT
2K
XP
K3
 FOR /L %%A IN (1,1,254) DO @(
  
(
SET "Alive=10.7.7.%%A")
   (%.Alive% %.Kity%)
 )

To see only the machines that are inaccessible, suppress STDOUT using the %.Quiet% command.

NT
2K
XP
K3
 FOR /L %%A IN (1,1,254) DO @(
  
(
SET "Alive=10.7.7.%%A")
   (%.Alive% %.Quiet%)
 )

Additional examples are on the pre-release .Alive Page.  There is also a link to download the code for .Alive so you can reap the rewards RIGHT NOW!  The pre-release code requires that you have Release 2004.03.28 or later of either ntlib.cmd or NTCmdLib.cmd.


Joe Fumer has been reading intently and thinking about the batch he uses to check the company's server farm.

"You mean--uh--you mean,  I can replace all of my Ping | Find  "Reply" stuff with something like:

FOR /F %%A IN (FumerFarm.txt) DO @(
    (
SET "Alive=%%A")
    (%.Silent% %.Alive%)
    (%.ifNotOK%
ECHO:Meltdown on Server %%A!)
)

" Yes!   YES!!    Y-E-S!!! "

"And I can run it on any machine in the house?!  Even my old NT4 Servers?!"

"You sure can, Joe!  You're really soakin' up that knowledge now!"

"I see the light!  I see the light!  How do I sign up?  When can I get my hands on that new Command Library?!"


The new Expert Library is nearing final trials!  When it comes out as *Pure^Gold*, we'll release it to the world!

The clock is ticking, so you better start clicking!!!

Make speed over to "The Almost Free Price List"!    NOW!

        Or risk being left behind in the fumes!


To subscribe to BoomingOrFuming?, first register, then follow the instructions on the contact page.

Space is limited and time is short, so reserve your spot today!
 

/\
//\\
//
The\
/Sy
stem\
////
Guard
\
COME ON UP WITH US!
and
Congratulations On Your Decision
to
RISE ABOVE
THE REST!

^
/
!\
/LIB\

TheSystemGuard.com [Revised: 2007-03-29]
Copyright © 1995-2007, JWC
Computer Communications,
All Rights Reserved, Worldwide.
 Disclaimer       Privacy       About Us       More


Communication Is Business!

We Master It With Knowledge!

^
/
.\
/M^C\