----^--->
/\

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

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

A TRIP UP THE CLIFFS OF IF - 20030115

Booming Or Fuming? | MasterCatalog | ntlib (FREE) | NTCmdLib | MtCmds | Scripts | Almost Free | TheGuardBook | Help

 

THE ANNOUNCING ISSUE - 20030101 | THE FIRING ISSUE - 20030108 | A TRIP UP THE CLIFFS OF IF - 20030115 | AIRBORNE ON SET RIDGE - 20030122 | DOWN IN THE DETAILS - 20030129 | TREASURES IN THE SAND - 20030205 | A PLAIN PATH THRU FOREST FINDSTR - 20030212

Are you Booming or Fuming?

A TRIP UP THE CLIFFS OF IF - 20030115!


Armed with our "Unique OS" command from last week, we're on our way up the "Cliffs of IF" to expand our understanding of what we've learned.

Come up with us! All Aboard! All Fumers!


Joe Fumer is on board again this week.

"Good Going Joe!"

Remember, M/\Cs are built on a "Threefold Cord of Knowledge" consisting of Compatibility, Clarity and Speed. Our unique OS command
 

FOR /F "tokens=2 delims=." %%A IN ('VER') DO ECHO:%%A

provides us with four unique strings as follows:

Windows NT4 SP6a = "0<space><space>"
Windows 2000 SP3 = "00"
Windows XP SP1 = "1"
Windows Server 2003 = "2"

We can use the SelectCase Pattern from (TSG_SelectCase.Pattern.cmd) to process this output. If you are reading this as a non-subscriber, you can obtain the Advanced Version of the above Script Pattern from the Scripts Page. (subscribers see attached .txt file; rename to .cmd before use).

After applying the pattern, and adding the result to our "FOR" command, we get:

01. FOR /F "tokens=2 delims=." %%A IN ('VER') DO @(
02.     IF "%%A"=="0 " (
03.         (
ECHO:NT)
04.         (
SET #OS=NT)
05.         (%.SetEL0%)
06.     )
ELSE (
07.        
IF "%%A"=="00" (
08.             (
ECHO:2K)
09.             (
SET #OS=2K)
10.             (%.SetEL1%)
11.         )
ELSE (
12.            
IF "%%A"=="1" (
13.                 (
ECHO:XP)
14.                 (
SET #OS=XP)
15.                 (%.SetEL2%)
16.             )
ELSE (
17.                
IF "%%A"=="2" (
18.                     (
ECHO:K3)
19.                     (
SET #OS=K3)
20.                     (%.SetEL3%)
21.                 )
ELSE (
22.                     (
ECHO:Unknown)
23.                     (
SET #OS=Unknown)
24.                     (%.SetEL123%)
25.                 )
26.             )
27.         )   
28.     )
29. )


There are many crevasses and craters on these cliffs but they can be avoided by paying careful attention to detail.  Multiple commands in a complex statement like the one above should ALWAYS be enclosed in ()'s to provide and maintain a clear understanding of what the script is trying to accomplish.

Pattern Scripts like SelectCase will help you avoid Syntax Ditches every time by providing FULLY DOCUMENTED WORKING EXAMPLES THAT YOU CAN CUT AND PASTE DIRECTLY INTO YOUR SCRIPTS TODAY!!

Remember, when you come to us HUNGRY for knowledge, we're going to TEACH you how to get the answer(s) you need -and- FEED you with a good hot meal of understanding at the same time! After all, FUMING and HUNGER go together!

We've made it through the "Labyrinths of FOR" and survived the "Cliffs of IF" to get this far. Next week, we'll show you the Cord of Speed, the final cord in our "Threefold Cord of Knowledge"! This will give us our first view from "UP HIGH" as we replace all the code we've developed so far (all 29 lines!) with the one-word Mount/\Command called ".GetOS".

DON'T MISS IT!

And be sure to tell someone else so all can benefit!


Joe likes climbing the mountain better than fuming at the foothills; he's even taken off his Fuming Glasses after grasping the Cord of Clarity this week!

HOLD ON JOE!!!

.GetOS and 50 other .Mount/\Commands are included in the FREE "Advanced NT/2K/XP Command Library". This library also includes the :FNL (File_Number_Lines) procedure to number your scripts (or any text file) like the example above. :FNL will add leading zeroes based on the total number of lines in the file to maintain a CONSISTENT column-width.

The "Almost Free" Expert NT/2K/XP Command Library includes over 300 M/\Cs plus dozens of other Resources -AND- an Interactive Mode to help you learn the power of this mighty tool. The Expert Library is available for $9 or less (quantity discounts start at 5 or more).

The complete .Mount/\Command Set is also available separately for $7 or less.


All of our products are completely written using ONLY what is available in ALL INSTALLATIONS of Windows NT4 SP6a, Windows 2000, Windows XP and Windows Server 2003. There is no binary code, only scripting commands.

No install/uninstall is required. As a matter of fact, NOTHING IS REQUIRED except the script itself! Everything else is already provided in a default Windows installation (see the Compatibility Page for details).


To start receiving BoomingOrFuming?, first register, then follow the instructions on the contact page.

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

We'll take you up the Mountain of Knowledge, which rises higher than all the other Hills of Confusion.

/\
//\\
//
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\