I am looking to upgrade the WMI on all of our machines to v4.5 for XP and Serv2003 and v5.0 for Win7/Serv2008. What I would like to do is have a script that would determine what OS the machine is running and return a value to batch script based on the OS version.

I am sure this is relatively simplistic, but I am a complete newb to scripting.

I have read the following:


and it seems to be fairly close to what I am wanting. Will the FindOSType = OSName provide a return to a batch script if this .vbs is called from the batch script?

I have a script that I use to determine if a machine is 32 bit or 64 bit and I would like to find a way to integrate all of this together as well.

Anyway, sorry to be the complete noob, but I hope someone can help me out with this.

0 Comments   [ + ] Show Comments


Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.


Why bother? The WMI package as supplied will do everything it needs to do.

If you're new to scripting, I'd recommend forgetting about batch files and do all your coding in script. Batch is restricting and you'll find millions of lines of VBS code for pretty much anything you want to do.

For a kick-off, have a search for any of my responses in this forum. You'll find a selection of links to sites which have code samples. Search for 'computerperformance' (that's one word).

I'll repeat my mantra, just for completeness: always code as if NOTHING works. So, when setting an object - even the basics like FileSystemObject - test that it got created before your next piece of code. If a function should return a string, make sure it got a string with content, not an empty one. And so on.
Answered 12/19/2010 by: VBScab
Red Belt

Please log in to comment
Unless I am missing something, MS says there are different files to install based on what OS the machine is running:


[hr]Download the file that is appropriate for your operating system version and platform.

For Windows Vista, Windows Vista Service Pack 1 and Windows Server 2008:
x86 Platform: Windows6.0-KB942288-v2-x86.msu
x64 Platform: Windows6.0-KB942288-v2-x64.msu
IA64 Platform: Windows6.0-KB942288-v2-ia64.msu

For Windows XP Service Pack 2 and Windows XP Service Pack 3 (32-bit platforms):
x86 Platform: WindowsXP-KB942288-v3-x86.exe

For Windows Server 2003 Service Pack 1, Windows Server 2003 Service Pack 2 and Windows XP 64-bit Editions:
x86 Platform: WindowsServer2003-KB942288-v4-x86.exe
x64 Platform: WindowsServer2003-KB942288-v4-x64.exe
IA64 Platform: WindowsServer2003-KB942288-v4-ia64.exe


And I do agree with you that I should be doing as much as possible through scripting. I am attempting to learn as much as possible, but I am a one man show splitting time between imaging, app deployment/scripting, inventory & asset management, hardware repair and AD administration. Only so many hours in the day so my learning process is a slow one. I'll do a quick scan for some of the resources you speak of...
Answered 12/20/2010 by: dyehardfan
Second Degree Blue Belt

Please log in to comment
if you need a bat command try something like this:

reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName

I would do as VBScab suggested and go pure vbscript, tho.
Answered 12/21/2010 by: hashref
Senior Yellow Belt

Please log in to comment
dyehardfan You have a K1000 and K2000; why not use those? The managed install, scripting, and/or patching features could easily target specific OS's and machines that are missing the applicable software.
Maybe that was your intent? If so, note that this thread is for general scripting, not K1000 scripting.
Answered 12/21/2010 by: cblake
Red Belt

Please log in to comment
Answer this question or Comment on this question for clarity