D
D F
I recently discovered WMI - The Windows Management Instrumentation.
This is a bit tech'y ... but it's all Free Software (well, free if
you've already purchased Windows, and don't mind browsing the MDSN.)
According to M$, "Windows Management Instrumentation (WMI) makes
Windows extremely manageable using a single consistent,
standards-based, extensible and object-orientated interface." (I
always HATED the word 'orientated' ... had to find something to hate
about that
Anyway, if you are running Windows 2000 or XP, you already have this
installed. (If you work in a network-heavy workplace, undoubtedly
your IT people ... ummm... the Saavyy ones, anyway... are already into
this big time.)
However, MS has also made a package available that provides this
capability on Win95 and Win98-level machines. (I am currently running
Win98 ... NOT SE, and using WMI with success.)
The page to Read about this capability is:
(the following is ONE line...)
http://www.microsoft.com/downloads/...BA-337B-4E92-8C18-A63847760EA5&displaylang=en
AND, the download link for the WMI Core 1.5 (you only need this if you
have Win95 or Win98) is:
http://download.microsoft.com/download/platformsdk/wmi9x/1.5/W9X/EN-US/wmi9x.exe
(Download is 3029K)
The link (today, anyway) to learn more about this is:
http://msdn.microsoft.com/library/en-us/dnanchor/html/anch_wmi.asp
Windows 95 and 98 users will also want to upgrade their Windows
Scripting Host (WSH)! Again, according to Microsoft: "If you are
currently using Windows 2000 or Windows ME, you have version 2.0 of
WSH installed on your computer system. If you are running Windows 95,
98, or Windows NT 4.0, you have version 1.0. To upgrade to WSH 5.6,
visit the Microsoft Windows Script Technologies Web site at
(http://msdn.microsoft.com/scripting/)."
The WSH 5.6 download for Win95,98 is discussed at:
http://msdn.microsoft.com/library/default.asp?url=/downloads/list/webdev.asp
and the Win9X, ME, NT4 download for WSH 5.6 is at:
(Link must be one line...)
http://download.microsoft.com/download/4/c/9/4c9e63f1-617f-4c6d-8faf-c2868f670c1c/scr56en.exe
(Download is 664K)
So, if you get all that installed, then you can really have fun... (It
is easy to install these packages, but you will want to READ a lot of
the material to get started.) Oops, I should mention that you also
need to keep your virus guard up, and not (NO NEVER) just run any old
VBscript you find on the Net.
WMI, using WSH (ala VBScript) has the potential to render all your
Win98 BATCH files obsolete,... the ones that you find yourself setting
up to run from Windows to get some of those system jobs done... The
proof is left to the reader (If you don't know what Batch files
are, just remember that I said this was a bit tech'y... and, if you
think Batch files are Tech'y, then stick with the prepackaged
installer-based Windows applications for now.)
For this example, here is a script that shows my Machine and Serial
Number:
---------- whoami.vbs -----------
On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer &
"\root\cimv2")
Set colItems = objWMIService.InstancesOf("Win32_SystemEnclosure")
For Each objItem in colItems
strMyHw = objItem.Manufacturer & " s/n " & objItem.SerialNumber
Next
Wscript.Echo strMyHw
---------- end whoami.vbs ---------
From the command prompt (DOS Prompt, with Windows running) you type:
DOS> cscript whoami.vbs
(... Note that cscript.exe is part of the WSH package and must be on
the 'DOS Path')
This shows... "Gateway s/n 0123456789" (...I'm faking this number!)
....for my machine.
To run from Windows (double clicking on the .vbs file) you only need
to associate .vbs with the application 'wscript.exe'... that is, the
command to run from the OPEN action is 'wscript.exe "%1"'
Just a few more examples...
The following script builds a string showing all the running processes
and then displays it:
-------- processes.vbs --------------
On Error Resume Next
strComputer = "."
strConfirm = ""
Set oCIM = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
For each Process in oCIM.ExecQuery("SELECT * FROM Win32_Process",,48)
strConfirm = strConfirm & vbCrLf & Process.Name
Next
WScript.Echo strConfirm
--------- end processes.vbs ----------
Here's a little WMI Script that shows all your installed Codecs and
any version information available...
--------- showcodecs.vbs ------------
On Error Resume Next
strComputer = "."
strCodec=""
Set objWMIService = GetObject("winmgmts:\\" & strComputer &
"\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from
Win32_CodecFile",,48)
For Each objItem in colItems
strCodec=strCodec & vbcrlf & "-- " & objItem.Description & " [" &
objItem.Version & "] (" & objItem.Manufacturer & ") " & objItem.Name
Next
Wscript.Echo strCodec
--------- end showcodecs.vbs ----------
This is pretty lame stuff on the XP OS... Just remember that I am
doing this on a Win98 machine! Well, so much for old DOS batch
files... For Lots and Lots of WSH and WMI help, just search Google
for those words,... and you won't come back for a while.
As the Wizard of Oz once said, "I can't come back! I don't know how
it works."
Dale Fordberg
P.S. More fun WMI tools are here:
Scriptomatic...
(One Line)
http://www.microsoft.com/downloads/...bd-c1c5-41e7-9da8-212c414a7ab0&DisplayLang=en
"Writing WMI Scripts Using the Scriptomatic Utility
This magical utility lets you write WMI scripts even if you don't
know the first thing about WMI. We [MS] recommend you read the
documentation for this utility (accompanied with utility) first before
you continue."
[Hint, DF] - For Win95, 98, you have to EDIT the .HTA file, so that it
starts the (one) DOS window using "command.com" instead of "cmd.exe"
(or use %COMSPEC% instead.... Then this fun little tool will run fine
on Win98 with all the other stuff installed! (Edit the .HTA file and
search for "cmd.exe")
(Download Link - One Line, 101K)
http://download.microsoft.com/download/.NetStandardServer/Utility/1.0/NT5XP/EN-US/scriptomatic.exe
TweakoMatic... (Just released recently)
(One Line)
http://www.microsoft.com/downloads/...1e-6c01-4447-bd7c-c09646d722c8&DisplayLang=en
"The Tweakomatic is a nifty new utility that writes scripts that allow
you to retrieve and/or configure Windows and Internet Explorer
settings. So what, you might ask. Well, think about it. Because these
are WMI scripts, they can be used to configure settings on remote
computers. Need to change something on a remote machine? Then haul out
the Tweakomatic. And think about this: because the Tweakomatic writes
scripts, you could do something like run these scripts as logon or
logoff scripts. In other words, you could quickly, easily, and
automatically configure settings on any or all the computers in your
organization."
(Download Link - One line, 258K)
http://download.microsoft.com/download/d/3/0/d3000559-ec45-40e0-bd36-e4aea5c15299/tweakomatic.EXE
BGInfo (from SysInternals)
http://www.sysinternals.com/ntw2k/freeware/bginfo.shtml
"How many times have you walked up to a system in your office and
needed to click through several diagnostic windows to remind yourself
of important aspects of its configuration, such as its name, IP
address, or operating system version? If you manage multiple computers
you probably need BGInfo. It automatically displays relevant
information about a Windows computer on the desktop's background, such
as the computer name, IP address, service pack version, and more. You
can edit any field as well as the font and background colors, and can
place it in your startup folder so that it runs every boot, or even
configure it to display as the background for the logon screen."
Copyright © 2000-2003 Bryce Cogswell
http://www.sysinternals.com/files/bginfo.zip
[Hints, DF] This one is highly interesting (if not that useful) to
play with on my home computer... But it is very easy to use, and
(here's the hint...) it has a GREAT browse and learn support for WMI
queries built in... You simply define a custom tag that accesses WMI,
and the tool will help you construct queries that show you the results
immediately. This one is just great fun to play with. (After all,
don't you already know that you have a Gateway, with Win98 and 196Meg
Memory, and 1.2Gig Freespace on the hard drive?) (It also annoys my
kids because it keeps writing the systems information into our desktop
backgrounds...) That's another interesting feature of this tool...
Suppose you have a tiled background on your desktop. BGInfo uses
that tile and builds its own background screen with the system report
integrated into the bitmap pattern, then installs that as the
background. All my kids have to do is change the background back to
their original tile, but they don't know that yet )
Enjoy.
DF
This is a bit tech'y ... but it's all Free Software (well, free if
you've already purchased Windows, and don't mind browsing the MDSN.)
According to M$, "Windows Management Instrumentation (WMI) makes
Windows extremely manageable using a single consistent,
standards-based, extensible and object-orientated interface." (I
always HATED the word 'orientated' ... had to find something to hate
about that
Anyway, if you are running Windows 2000 or XP, you already have this
installed. (If you work in a network-heavy workplace, undoubtedly
your IT people ... ummm... the Saavyy ones, anyway... are already into
this big time.)
However, MS has also made a package available that provides this
capability on Win95 and Win98-level machines. (I am currently running
Win98 ... NOT SE, and using WMI with success.)
The page to Read about this capability is:
(the following is ONE line...)
http://www.microsoft.com/downloads/...BA-337B-4E92-8C18-A63847760EA5&displaylang=en
AND, the download link for the WMI Core 1.5 (you only need this if you
have Win95 or Win98) is:
http://download.microsoft.com/download/platformsdk/wmi9x/1.5/W9X/EN-US/wmi9x.exe
(Download is 3029K)
The link (today, anyway) to learn more about this is:
http://msdn.microsoft.com/library/en-us/dnanchor/html/anch_wmi.asp
Windows 95 and 98 users will also want to upgrade their Windows
Scripting Host (WSH)! Again, according to Microsoft: "If you are
currently using Windows 2000 or Windows ME, you have version 2.0 of
WSH installed on your computer system. If you are running Windows 95,
98, or Windows NT 4.0, you have version 1.0. To upgrade to WSH 5.6,
visit the Microsoft Windows Script Technologies Web site at
(http://msdn.microsoft.com/scripting/)."
The WSH 5.6 download for Win95,98 is discussed at:
http://msdn.microsoft.com/library/default.asp?url=/downloads/list/webdev.asp
and the Win9X, ME, NT4 download for WSH 5.6 is at:
(Link must be one line...)
http://download.microsoft.com/download/4/c/9/4c9e63f1-617f-4c6d-8faf-c2868f670c1c/scr56en.exe
(Download is 664K)
So, if you get all that installed, then you can really have fun... (It
is easy to install these packages, but you will want to READ a lot of
the material to get started.) Oops, I should mention that you also
need to keep your virus guard up, and not (NO NEVER) just run any old
VBscript you find on the Net.
WMI, using WSH (ala VBScript) has the potential to render all your
Win98 BATCH files obsolete,... the ones that you find yourself setting
up to run from Windows to get some of those system jobs done... The
proof is left to the reader (If you don't know what Batch files
are, just remember that I said this was a bit tech'y... and, if you
think Batch files are Tech'y, then stick with the prepackaged
installer-based Windows applications for now.)
For this example, here is a script that shows my Machine and Serial
Number:
---------- whoami.vbs -----------
On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer &
"\root\cimv2")
Set colItems = objWMIService.InstancesOf("Win32_SystemEnclosure")
For Each objItem in colItems
strMyHw = objItem.Manufacturer & " s/n " & objItem.SerialNumber
Next
Wscript.Echo strMyHw
---------- end whoami.vbs ---------
From the command prompt (DOS Prompt, with Windows running) you type:
DOS> cscript whoami.vbs
(... Note that cscript.exe is part of the WSH package and must be on
the 'DOS Path')
This shows... "Gateway s/n 0123456789" (...I'm faking this number!)
....for my machine.
To run from Windows (double clicking on the .vbs file) you only need
to associate .vbs with the application 'wscript.exe'... that is, the
command to run from the OPEN action is 'wscript.exe "%1"'
Just a few more examples...
The following script builds a string showing all the running processes
and then displays it:
-------- processes.vbs --------------
On Error Resume Next
strComputer = "."
strConfirm = ""
Set oCIM = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
For each Process in oCIM.ExecQuery("SELECT * FROM Win32_Process",,48)
strConfirm = strConfirm & vbCrLf & Process.Name
Next
WScript.Echo strConfirm
--------- end processes.vbs ----------
Here's a little WMI Script that shows all your installed Codecs and
any version information available...
--------- showcodecs.vbs ------------
On Error Resume Next
strComputer = "."
strCodec=""
Set objWMIService = GetObject("winmgmts:\\" & strComputer &
"\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from
Win32_CodecFile",,48)
For Each objItem in colItems
strCodec=strCodec & vbcrlf & "-- " & objItem.Description & " [" &
objItem.Version & "] (" & objItem.Manufacturer & ") " & objItem.Name
Next
Wscript.Echo strCodec
--------- end showcodecs.vbs ----------
This is pretty lame stuff on the XP OS... Just remember that I am
doing this on a Win98 machine! Well, so much for old DOS batch
files... For Lots and Lots of WSH and WMI help, just search Google
for those words,... and you won't come back for a while.
As the Wizard of Oz once said, "I can't come back! I don't know how
it works."
Dale Fordberg
P.S. More fun WMI tools are here:
Scriptomatic...
(One Line)
http://www.microsoft.com/downloads/...bd-c1c5-41e7-9da8-212c414a7ab0&DisplayLang=en
"Writing WMI Scripts Using the Scriptomatic Utility
This magical utility lets you write WMI scripts even if you don't
know the first thing about WMI. We [MS] recommend you read the
documentation for this utility (accompanied with utility) first before
you continue."
[Hint, DF] - For Win95, 98, you have to EDIT the .HTA file, so that it
starts the (one) DOS window using "command.com" instead of "cmd.exe"
(or use %COMSPEC% instead.... Then this fun little tool will run fine
on Win98 with all the other stuff installed! (Edit the .HTA file and
search for "cmd.exe")
(Download Link - One Line, 101K)
http://download.microsoft.com/download/.NetStandardServer/Utility/1.0/NT5XP/EN-US/scriptomatic.exe
TweakoMatic... (Just released recently)
(One Line)
http://www.microsoft.com/downloads/...1e-6c01-4447-bd7c-c09646d722c8&DisplayLang=en
"The Tweakomatic is a nifty new utility that writes scripts that allow
you to retrieve and/or configure Windows and Internet Explorer
settings. So what, you might ask. Well, think about it. Because these
are WMI scripts, they can be used to configure settings on remote
computers. Need to change something on a remote machine? Then haul out
the Tweakomatic. And think about this: because the Tweakomatic writes
scripts, you could do something like run these scripts as logon or
logoff scripts. In other words, you could quickly, easily, and
automatically configure settings on any or all the computers in your
organization."
(Download Link - One line, 258K)
http://download.microsoft.com/download/d/3/0/d3000559-ec45-40e0-bd36-e4aea5c15299/tweakomatic.EXE
BGInfo (from SysInternals)
http://www.sysinternals.com/ntw2k/freeware/bginfo.shtml
"How many times have you walked up to a system in your office and
needed to click through several diagnostic windows to remind yourself
of important aspects of its configuration, such as its name, IP
address, or operating system version? If you manage multiple computers
you probably need BGInfo. It automatically displays relevant
information about a Windows computer on the desktop's background, such
as the computer name, IP address, service pack version, and more. You
can edit any field as well as the font and background colors, and can
place it in your startup folder so that it runs every boot, or even
configure it to display as the background for the logon screen."
Copyright © 2000-2003 Bryce Cogswell
http://www.sysinternals.com/files/bginfo.zip
[Hints, DF] This one is highly interesting (if not that useful) to
play with on my home computer... But it is very easy to use, and
(here's the hint...) it has a GREAT browse and learn support for WMI
queries built in... You simply define a custom tag that accesses WMI,
and the tool will help you construct queries that show you the results
immediately. This one is just great fun to play with. (After all,
don't you already know that you have a Gateway, with Win98 and 196Meg
Memory, and 1.2Gig Freespace on the hard drive?) (It also annoys my
kids because it keeps writing the systems information into our desktop
backgrounds...) That's another interesting feature of this tool...
Suppose you have a tiled background on your desktop. BGInfo uses
that tile and builds its own background screen with the system report
integrated into the bitmap pattern, then installs that as the
background. All my kids have to do is change the background back to
their original tile, but they don't know that yet )
Enjoy.
DF