[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 710
  • Last Modified:

wmic product and updates

HI

Is there a way to run these two wmi scripts into the same output file ??

The second script always replaces the first script

WMIC product get Description, InstallDate, Name, Vendor, Version  > c:\1.txt
WMIC qfe get description, FixComments, HotFixID, InstalledBy, InstalledOn, ServicePackInEffect   > c:\1.txt
0
41 01
Asked:
41 01
  • 2
1 Solution
 
Rob MinersCommented:
Add another > greater than redirector to your second command line.

WMIC product get Description, InstallDate, Name, Vendor, Version > c:\1.txt

WMIC qfe get description, FixComments, HotFixID, InstalledBy, InstalledOn, ServicePackInEffect >> c:\1.txt

ref# http://www.bleepingcomputer.com/tutorials/windows-command-prompt-introduction/#red
0
 
41 01Author Commented:
that worked great, is it possible to output both files to one html file ?
0
 
Lee W, MVPTechnology and Business Process AdvisorCommented:
As far as I recall, WMIC doesn't have save as capabilities.  If you want to save as HTML, I recommend purchasing the tool System Information for Windows - I believe there's a free non-commercial version if that's your purpose or for trial - that is scriptable, a single executable, and can save to HTML, CSV, and other forms and gives a TON of information on the system.

www.gtopala.com
0
 
Rob MinersCommented:
Try this and see if it's to your liking,  you can use hform or htable to create htm

WMIC product get Description, InstallDate, Name, Vendor, Version /format:hform > c:\1.htm

WMIC qfe get description, FixComments, HotFixID, InstalledBy, InstalledOn, ServicePackInEffect /format:hform >> c:\1.htm

WMIC product get Description, InstallDate, Name, Vendor, Version /format:htable > c:\12.htm

WMIC qfe get description, FixComments, HotFixID, InstalledBy, InstalledOn, ServicePackInEffect /format:htable >> c:\12.htm
 
I had to follow the below procedure before I could get any output

Fix the “Invalid XSL format (or) file name” Error

http://acidx.net/wordpress/2012/09/retrieving-system-information-via-command-line-on-windows/

I'm in Australia so I had to create the below directory and add the files for the formats.

C:\Windows\System32\wbem\en-au>dir /a /b
csv.xsl
hform.xsl
htable.xsl
mof.xsl
xml.xsl

ref# http://technet.microsoft.com/en-us/library/bb742610.aspx
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now