@echo off
if %1!==! goto SHOW_SYNTAX
echo.
echo This will install the Windows for Workgroups 3.11 Y2K fix (Winfile.exe).
echo.
echo If you are running any other version of Windows, or if you do not want
echo to install this fix, press Ctrl+C to terminate this batch file.  Otherwise,
pause

:DO_WINCHECK
if not exist %1\win.com goto SHOW_SYNTAX
if not exist %1\winver.exe goto SHOW_SYNTAX
REM WFWG 3.11?
if not exist %1\SYSTEM\IFSMGR.386 goto BAD_WINVER
if not exist %1\SYSTEM\VXDLDR.386 goto BAD_WINVER
REM Win9x?
if exist %1\SYSTEM\VMM32.VXD goto BAD_WINVER
REM WinNT?
if exist %1\SYSTEM32\NTOSKRNL.EXE goto BAD_WINVER
goto DO_FILECHECK

:DO_FILECHECK
if not exist %1\winfile.exe goto DO_COPY
attrib -r -s -h %1\winfile.exe > nul
if exist %1\winfile.old goto DO_COPY

:DO_BACKUP
ren %1\winfile.exe winfile.old > nul

:DO_COPY
copy winfile.y2k %1\winfile.exe
if not exist %1\winfile.exe goto COPY_FAILED
echo.
echo Update complete!
goto END

:COPY_FAILED
echo Update failed.
goto END

:BAD_WINVER
echo This update is not designed for your version of Windows.
goto END

:SHOW_SYNTAX
echo Run this command again, and specify the path to your Windows directory,
echo as in the following example:
echo.
echo 	%0 C:\WINDOWS

:END
echo.
