I was kind of startled by Ed Cryer's remark (requoted here for ease of
finding), which I failed to understand:
"If you'd done as much system testing as I have on large-scale govt
systems, you'd have learnt not to tinker with the test-beds. Only change
required bits, bits that have failed; otherwise you can easily throw in
new bugs that'll compound the issue."
I'll agree with Ed's comments to the extent that when in a business
environment one is trying to find what is causing a program to blow up you
want to be extremely paranoid about making *any* change that's not
documented six ways from Sunday and signed off by a flag officer: your
report will be read by individuals who are clueless about the details of
what you did in the test but who will attack you if you can't reproduce the
exact same response on demand. OTOH, for an informal environment like this,
with a single command line that can be tried with any number of variations,
the rules should be a bit more relaxed. And yes, part of my job is often to
find the buggy needle in a county-wide haystack full of unbuggy needles that
look the same. ("Twisty little passages, all alike" if you prefer.)
I had also changed the %temp% to something more convenient
...and perhaps I should point out that when I introduced the WMIC command
into this thread I needed to use parameters that were likely to work on all
systems, and for output, using %TEMP% to point to the local temporary folder
is about the only one that will work with XP and everything above unless
someone's screwed up the file system permissions. [*]
Changing the destination of an output redirect is about the least dangerous
things to do when altering an example command line. It's not absolutely
safe but is reasonably so as long as you don't get careless.
[*] The WMIC QFE command will run on XP, but don't trust the output. To
enumerate the installed updates it's much safer (and easier) if you use the
Registry (HKLM\Software\Microsoft\Updates\Windows XP) since WMIC gives
strange results; install and use QFECHECK instead.
In Vista and Windows 7 the information is no longer in the Registry, which
forced my shop to abandon our mature compliance audit tool and find a new
one.
Your idea that he's not familiar with redirection seems to make sense,
however, and it makes his attitude more understandable - and hence more
acceptable - to me.
BTW, I also fiddled a bit with the arguments, but I didn't find out much
and lost interest
I have no idea of its history, but WMIC shows many of the earmarks of a
command that was designed by a committee. I noted upthread that it's
extremely fragile and poorly documented, although the APIs available through
.NET (and thus in PowerShell) are nice.
If you want to dig down into the data buried in WMI you might want to
experiment with the WBEMTEST command. Like WMIC it will never be considered
to have an intuitive user interface, but there are several good entries on
Microsoft's web site; search for "WBEMTEST".
Joe