Determining Win95 machines via login script

B

Bart Perrier

I am needing to deploy some software to workstations that are Windows 95
(this is not a typo).

What I have done so far is define a BAT file in AD for the User Login Script
that uses the START \\myvbScript.vbs.

The vbScript then tries to make a WINMGTS: connection and when it fails
(Err.Number = 432, Class does not exist) it calls my 9xInstall.BAT file. For
the most part this works since we do not have the WMI Core Environment out
there but I'd rather be checking for the OS specifically, since that is what
I really need to know. Unfortunately, I cannot find a way to do this without
using WMI.

Is there an object I can use to get the OS in vbScript or even a command in
the BAT file that I can rely on?

As always, thanks.
Bart Perrier
 
T

Torgeir Bakken \(MVP\)

Bart said:
I am needing to deploy some software to workstations that are Windows 95
(this is not a typo).

What I have done so far is define a BAT file in AD for the User Login Script
that uses the START \\myvbScript.vbs.

The vbScript then tries to make a WINMGTS: connection and when it fails
(Err.Number = 432, Class does not exist) it calls my 9xInstall.BAT file. For
the most part this works since we do not have the WMI Core Environment out
there but I'd rather be checking for the OS specifically, since that is what
I really need to know. Unfortunately, I cannot find a way to do this without
using WMI.

Is there an object I can use to get the OS in vbScript or even a command in
the BAT file that I can rely on?
Hi,

To detect the OS version, see e.g. the function GetOsVersionNumber here
(uses WSH's RegRead to determine the OS version):
http://groups.google.co.uk/group/mi...yment/msg/0578b298bc7c08a9?dmode=source&hl=en

It will return 0 for Win9x and WinMe.


If you need to be able to difference on Win95, Win98 and WinMe, just
say so.
 
D

Dean Wells [MVP]

Maybe -

ver | find "Windows 95" >nul
if errorlevel 1 (
goto :notWindows95
) else (
goto :Windows95
)
 
B

Bill Stewart

Bart said:
I am needing to deploy some software to workstations that are Windows 95
(this is not a typo).

What I have done so far is define a BAT file in AD for the User Login Script
that uses the START \\myvbScript.vbs.

The vbScript then tries to make a WINMGTS: connection and when it fails
(Err.Number = 432, Class does not exist) it calls my 9xInstall.BAT file. For
the most part this works since we do not have the WMI Core Environment out
there but I'd rather be checking for the OS specifically, since that is what
I really need to know. Unfortunately, I cannot find a way to do this without
using WMI.

Is there an object I can use to get the OS in vbScript or even a command in
the BAT file that I can rely on?

You can also try my freeware utility osver.exe.

http://www.cybermesa.com/~bstewart/wast.html
 
T

Todd Vargo

Dean Wells said:
Maybe -

ver | find "Windows 95" >nul
if errorlevel 1 (
goto :notWindows95
) else (
goto :Windows95
)

OS detection code needs to work on all possible OS's. The IF command syntax
above will not work on Win9x/ME systems. Also Win9x systems only see the
first eight characters of label names. If OP uses a goto:Windows95 and
goto:Windows98, they will both point to the first :Windows9? label on Win9x
systems.

ver | find "Windows 95" >nul
if not errorlevel 1 goto :Win95
ver | find "Windows 98" >nul
if not errorlevel 1 goto :Win98
ver | find "Windows ME" >nul
if not errorlevel 1 goto :WinME
....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top