hi,

how can we ge the version of os installed using script.

Re: script for getting os version by ekkehard

ekkehard
Tue Jul 11 05:03:00 CDT 2006

Nuti wrote:
> hi,
>
> how can we ge the version of os installed using script.
>
http://www.visualbasicscript.com/m_25374/tm.htm

Re: script for getting os version by mayayana

mayayana
Tue Jul 11 07:55:06 CDT 2006

>
> how can we ge the version of os installed using script.
>
I'm not certain about this, but you should be able
to get it by checking the version of kernel32.dll, which
will be in the %SYSTEM% folder:

Dim FSO, sys
Set FSO = CreateObject("Scripting.FileSystemObject")
sys = FSO.GetSpecialFolder(1)
sys = sys & "\KERNEL32.DLL"
MsgBox FSO.GetFileVersion(sys)
Set FSO = Nothing

It should work because the kernel basically is the OS,
but I haven't checked that file's version number across
Windows versions. Maybe someone else can confirm it.

The nice thing about the above method, in addition to being
simple, is that it doesn't require special hacks and doesn't
need WMI installed.

(It might be interesting to run Filemon and Regmon while
the WMI version-finding script is run, to see where that's
getting the information.)