PDA

View Full Version : Re: shell or VB scripting


guard
December 6th 03, 02:12 PM
"Robin" wrote
>
> Thanks for your reply!
>
> However, im very new to scripting and stuff, and was
> wondering if you could shed a little bit more light on
> what you have just written!? I have had a look at that
> link that was in ur reply, but Im still a little confused!?
>
> Thanks

See below.

<SNIP>
> >>
> >> I was going to try and write a batch file, but maybe a
> >> script might be better. I am trying to automate something
> >> depending on what version of Windows is running, i.e 2000
> >> or XP. Basically if it is 2000 then I want it to do one
> >> thing and if its XP then I want it to do another!
> >>
> >> Can anybody point me in the right direction please?
> >
> >The Mount/\Command "GetOS" provides the following:
> >
> >1. Displays the current Operating System
> >2. Saves the value in the variable %#os%
> >3. Sets an errorlevel based on the result
> >
> >GetOS performs CONSISTENTLY under NT/2K/XP/K3. It is
> included in the FREE
> >Advanced NT/2K/XP Command Library (http://ntlib.com)

For a color-keyed step by step explanation of how the command ".GetOS" is
constructed, see the sample issues of our KnowledgeLetter "Booming or
Fuming?" at (http://BoomingorFuming.com). Specifically, the issues titled

THE FIRING ISSUE - 20030108
A TRIP UP THE CLIFFS OF IF - 20030115
AIRBORNE ON SET RIDGE - 20030122

*******

..GetOS is a Mount/\Command.

The essence of Mount/\Commands is to write a complete shell script (aka, a
batch file) in such a way that it can be compressed to a SINGLE LINE of
code. This one line script is then loaded into the local environment. The
environment is a temporary area used to hold commonly needed values (type
"SET" at a command prompt to see what's in your environment). Also, see the
"SET Page" at (http://TheSystemGuard.com/TheGuardBook/CCS-Int/SET.htm) for a
combined Windows NT, 2000, XP and 2003 syntax listing.

Mount/\Commands are used in place of third party utilities to provide needed
features that are not easily available using only what comes with the
operating system. Even though most administrative tasks can be accomplished
using the built-in command line utilities, it often requires memorizing
obscure scripting techniques and lots of "special cases". Even though a
"FREE" answer can usually be obtained from someone more knowledgeable than
yourself, you have to maintain that code going forward.

We take the (often convoluted) scripting code required to get the job done
and replace it with a single word Mount/\Command that sounds like what it
does (i.e. GetOS, which means "Get Operating System"). Each Mount/\Command
automatically adjusts itself to the current operating system and machine
configuration when it is loaded.

This allows us to have commands like

%.ifNT% (Your NT-only Code Here)

%.ifServer% (your server-only code here)

%.TimeEcho% Backup Job Started

Each of the above commands performs CONSISTENTLY regardless of differences
in operating systems or variations in regional time format.

For color-keyed examples, see
(http://TheSystemGuard.com/MtCmds/IfCondition/ifNT.htm)
(http://TheSystemGuard.com/MtCmds/IfCondition/ifServer.htm)
(http://TheSystemGuard.com/MtCmds/ValueEcho)

*******

We package our products into "Command Libraries" and "Command Sets", which
are really just large, highly optimized, shell scripts (.cmd files).
Because they are shell scripts with NO BINARY CODE, most companies allow
them to be used wherever "batch files" are allowed. They are always
completely contained within a single file (including help screens) and
require no installation or uninstallation. You only have to keep track of
ONE FILE to take advantage of hundreds of new commands (instead of dozens of
extra utilities). And your scripts will perform CONSISTENTLY on every
installation of Windows NT, 2000, XP or Server 2003.
See (http://TheSystemGuard.com/Compatibility.htm).

<SNIP>

*******

If you need further assistance or clarification, please contact us directly.
See (http://TheSystemGuard.com/contact.htm).


-tsg
__________________________________________________ __________
TheSystemGuard.com | BoomingOrFuming.com | MountCommands.com
Free and "Almost Free" Knowledge for Windows System Admins!

Al Dunbar
December 6th 03, 02:12 PM
"guard" > wrote in message
...
> "Robin" wrote
> >
> > Thanks for your reply!
> >
> > However, im very new to scripting and stuff, and was
> > wondering if you could shed a little bit more light on
> > what you have just written!? I have had a look at that
> > link that was in ur reply, but Im still a little confused!?

Robin: please keep asking until he provides information in a form that you
can readily understand.

/Al

> >
> > Thanks
>
> See below.
>
> <SNIP>
> > >>
> > >> I was going to try and write a batch file, but maybe a
> > >> script might be better. I am trying to automate something
> > >> depending on what version of Windows is running, i.e 2000
> > >> or XP. Basically if it is 2000 then I want it to do one
> > >> thing and if its XP then I want it to do another!
> > >>
> > >> Can anybody point me in the right direction please?
> > >
> > >The Mount/\Command "GetOS" provides the following:
> > >
> > >1. Displays the current Operating System
> > >2. Saves the value in the variable %#os%
> > >3. Sets an errorlevel based on the result
> > >
> > >GetOS performs CONSISTENTLY under NT/2K/XP/K3. It is
> > included in the FREE
> > >Advanced NT/2K/XP Command Library (http://ntlib.com)
>
> For a color-keyed step by step explanation of how the command ".GetOS" is
> constructed, see the sample issues of our KnowledgeLetter "Booming or
> Fuming?" at (http://BoomingorFuming.com). Specifically, the issues titled
>
> THE FIRING ISSUE - 20030108
> A TRIP UP THE CLIFFS OF IF - 20030115
> AIRBORNE ON SET RIDGE - 20030122
>
> *******
>
> .GetOS is a Mount/\Command.
>
> The essence of Mount/\Commands is to write a complete shell script (aka, a
> batch file) in such a way that it can be compressed to a SINGLE LINE of
> code. This one line script is then loaded into the local environment.
The
> environment is a temporary area used to hold commonly needed values (type

> "SET" at a command prompt to see what's in your environment). Also, see
the
> "SET Page" at (http://TheSystemGuard.com/TheGuardBook/CCS-Int/SET.htm) for
a
> combined Windows NT, 2000, XP and 2003 syntax listing.
>
> Mount/\Commands are used in place of third party utilities to provide
needed
> features that are not easily available using only what comes with the
> operating system. Even though most administrative tasks can be
accomplished
> using the built-in command line utilities, it often requires memorizing
> obscure scripting techniques and lots of "special cases". Even though a
> "FREE" answer can usually be obtained from someone more knowledgeable than
> yourself, you have to maintain that code going forward.
>
> We take the (often convoluted) scripting code required to get the job done
> and replace it with a single word Mount/\Command that sounds like what it
> does (i.e. GetOS, which means "Get Operating System"). Each
Mount/\Command
> automatically adjusts itself to the current operating system and machine
> configuration when it is loaded.
>
> This allows us to have commands like
>
> %.ifNT% (Your NT-only Code Here)
>
> %.ifServer% (your server-only code here)
>
> %.TimeEcho% Backup Job Started
>
> Each of the above commands performs CONSISTENTLY regardless of differences
> in operating systems or variations in regional time format.
>
> For color-keyed examples, see
> (http://TheSystemGuard.com/MtCmds/IfCondition/ifNT.htm)
> (http://TheSystemGuard.com/MtCmds/IfCondition/ifServer.htm)
> (http://TheSystemGuard.com/MtCmds/ValueEcho)
>
> *******
>
> We package our products into "Command Libraries" and "Command Sets", which
> are really just large, highly optimized, shell scripts (.cmd files).
> Because they are shell scripts with NO BINARY CODE, most companies allow
> them to be used wherever "batch files" are allowed. They are always
> completely contained within a single file (including help screens) and
> require no installation or uninstallation. You only have to keep track of
> ONE FILE to take advantage of hundreds of new commands (instead of dozens
of
> extra utilities). And your scripts will perform CONSISTENTLY on every
> installation of Windows NT, 2000, XP or Server 2003.
> See (http://TheSystemGuard.com/Compatibility.htm).
>
> <SNIP>
>
> *******
>
> If you need further assistance or clarification, please contact us
directly.
> See (http://TheSystemGuard.com/contact.htm).
>
>
> -tsg
> __________________________________________________ __________
> TheSystemGuard.com | BoomingOrFuming.com | MountCommands.com
> Free and "Almost Free" Knowledge for Windows System Admins!
>
>

Google