Batch or VB script to determine what version of Windows (XP or 7) our machines are?

hi guys

We are trying to deploy software, either 32 bit or 64 bit, depending on the version of Windows. However, there are around 150 PC's and we just wanted to know whether we have Windows XP or Windows7 on these PC's.

Is there a way I can run a batch file or VB script on our Domain Controller to obtain this information? I can see that in AD, if I right click on the computer properties and select the Operating System tab that this information is available, but is there a way we could extract that information with a script and associate that OS to the computer name?

The controller is a Windows 2003 version.

Thanks for helping


pls try


pls try

Hey Rgonzo,

Thanks so much for sending me this. I tried this by making it a VBS script and ran it. Sadly it errored.

replace Debug.Print with WScript.Echo

Same thing.

I get an error saying 'Windows Script Host'

Line: 7
Char: 1
Error: Expected Statement
Code 800A0400
Source; Microsoft VBscript compilation error.

Is this supposed to output a text file or export into a specific location?

delete end sub

Share this

Related Posts