Previous | Next

Implementing Version Checking for Automated Installations

No matter which method of automated installation you use, it is a good idea to check the operating system version before running Windows 98 Setup. That way you can ensure that Windows 98 is never installed over itself, or on a computer running an incompatible operating system, such as Windows NT. You can do so from a batch file.

The following is an example of a simple batch file, VerCheck.bat, that checks your operating system version and runs Setup only if the computer is running Windows 95. You can tailor this batch file to your own needs.

@echo off
ver > ver.txt

find "95" ver.txt > nul
if errorlevel 2 goto broken
if errorlevel 1 goto not95
if errorlevel 0 goto found95
echo Broke while looking for 95.  
Please contact your network
echo administrator for help.
goto end

:not95
find "98" ver.txt > nul
if errorlevel 2 goto broken
if errorlevel 1 goto not98
if errorlevel 0 goto found98
echo Broke while looking for 98.  
Please contact your network 
echo administrator for help.
goto end
:not98
echo Could not identify operating system. 
Please contact your network 
echo administrator.
goto end

:found98
echo Found Windows 98 and will not install Windows 98.
goto end

:found 95
REM This procedure runs Setup if Windows 95 is found. 
If desired, you
REM could instead run another batch file.
echo Found Windows 95. 
Will now upgrade this computer to Windows 98.
Map S: \\Server\Share
S:\Directory\Setup
goto end

:broken
echo Could not upgrade this computer to Windows 98. 
Please contact your
echo network administrator.
goto end

:end

You can refine this sample batch file in many different ways. For example, note that this batch file runs Setup immediately after discovering that the computer is running Windows 95. By using two batch files, you could ensure that Setup waits until the next boot.

To ensure that Setup waits until the next boot

  1. Create a batch file named Winstart.bat that runs Setup, and place it on a network server.
  2. Create a second batch file that checks for Windows 95, and if it finds Windows 95, copies a second batch file named Winstart.bat from the network server to the user’s \Windows directory.

    Note

    This step will not work if users have renamed their Windows directories.