What does the environment variable %OS% contain on an XP computer? I believe that it is "Windows_NT". That would be the same as NT and Windows 2000.
Try this older version of batch file from my archive. I think that this is what you want with minimal overhead.
code:
IF '%OS%'=='Windows_NT' GOTO HWchk
SET windir=
SET winbootdir=
IF '%windir%'=='' SET OS=DOS
IF '%OS%'=='' IF '%winbootdir%'=='' SET OS=Windows_3.x
IF '%OS%'=='' SET OS=Windows_95
IF '%OS%'=='Windows_95' GOTO Win95
:HWchk
IF '%PROCESSOR_ARCHITECTURE%'=='x86' GOTO WinNT
echo PROCESSOR_ARCHITECTURE=%PROCESSOR_ARCHITECTURE% >>%TEMP%\Logon.log
goto End
:Win311
echo Windows 3.11 is not supported!
pause
goto End
:WinNT
date<nul >>%TEMP%\Logon.log
echo. >>%TEMP%\Logon.log
time<nul >>%TEMP%\Logon.log
echo. >>%TEMP%\Logon.log
set COPYCMD=/Y
IF NOT exist %systemroot%\kix32.exe echo Copying Kixtart files.
xcopy %0\..\kix32\kix32.exe %systemroot%\ /D 1>nul 2>>%TEMP%\Logon.log
if errorlevel 1 echo An error occurred while copying kix32.exe.
echo %systemroot%\kix32.exe %0\..\corp.kix >>%TEMP%\Logon.log
%systemroot%\kix32.exe %0\..\corp.kix
goto End
:Win95
IF NOT exist %winbootdir%\kix32.exe echo Copying Kixtart files.
xcopy %0\..\kix32\kix32.exe %winbootdir%\ /D >>%TEMP%\Logon.log
if errorlevel 1 echo An error occurred while copying kix32.exe.
xcopy %0\..\kix32\kx32.dll %winbootdir%\ /D >>%TEMP%\Logon.log
if errorlevel 1 echo An error occurred while copying kx32.dll.
xcopy %0\..\kix32\kx16.dll %winbootdir%\ /D >>%TEMP%\Logon.log
if errorlevel 1 echo An error occurred while copying kx16.dll.
xcopy %0\..\kix32\kx95.dll %winbootdir%\ /D >>%TEMP%\Logon.log
if errorlevel 1 echo An error occurred while copying kx95.dll.
echo. >>%TEMP%\Logon.log
echo Finish Xcopy >>%TEMP%\Logon.log
echo. >>%TEMP%\Logon.log
echo %winbootdir%\kix32.exe %0\..\corp.kix >>%TEMP%\Logon.log
%winbootdir%\kix32.exe %0\..\corp.kix
goto End
<br>
:END
echo End of corp_v1.bat >>%TEMP%\Logon.log
{edit}
I am guessing that you only need to differentiate Win9x from the other so that you copy the right files or something similar. Once the Kixtart script starts you can differentiate more finely.
[ 06 April 2002, 22:08: Message edited by: Howard Bullock ]