@echo off
cls

rem makedisk batch file
rem created 07/19/2002
rem Version 5.0
rem last modified 03/24/05

rem minimum requirements DOS 6.22 or NT 3.51 or Windows 95 or newer

rem Check available environment space
set env_chk=0123456789abcdef
if %env_chk% == 0123456789abcdef goto preprocess
goto env_bad

:preprocess
set env_chk=
if "%4" == "copy" set gui=copy
if "%4" == "copy_second" set gui=copy_second
if NOT "%_silent%" == "" goto env_ok
set _silent=TRUE
if "%3" == "silent" %0 %1 %2
if "%3" == "SILENT" %0 %1 %2
if "%2" == "silent" %0 %1 %3
if "%2" == "SILENT" %0 %1 %3
if "%1" == "silent" %0 %2 %3
if "%1" == "SILENT" %0 %2 %3
set _silent=FALSE

:env_ok
rem ****************************************************************************************************************
rem Check that OS (%1) and destination (%2) are supplied and valid**************************************************
rem ****************************************************************************************************************

if "%1" == "" goto USAGE
set dest=
if NOT "%gui%" == "" goto gui_dest
if "%2" == "" set dest=A:
if "%2" == "A:" set dest=A:
if "%2" == "a:" set dest=A:
if "%2" == "A:\" set dest=A:
if "%2" == "a:\" set dest=A:
if "%2" == "B:" set dest=B:
if "%2" == "b:" set dest=B:
if "%2" == "B:\" set dest=B:
if "%2" == "b:\" set dest=B:
if "%dest%" == "" goto setdest
set _mdisk_floppy=TRUE
goto dest_ok

:gui_dest
if %2 == "" set dest=A:
if %2 == "A:" set dest=A:
if %2 == "a:" set dest=A:
if %2 == "A:\" set dest=A:
if %2 == "a:\" set dest=A:
if %2 == "B:" set dest=B:
if %2 == "b:" set dest=B:
if %2 == "B:\" set dest=B:
if %2 == "b:\" set dest=B:
if "%dest%" == "" goto setdest
set _mdisk_floppy=TRUE
goto dest_ok

:setdest
set dest=%2
set _mdisk_floppy=FALSE
goto dest_ok

:dest_ok
if not exist ..\..\VERFILE.TIC goto wrongdir
if "%1" == "ws03xp2kfe" goto valid
if "%1" == "WS03XP2KFE" goto valid
if "%1" == "ws03xp2kgig" goto valid
if "%1" == "WS03XP2KGIG" goto valid
if "%1" == "ws03xp2kpcie" goto valid
if "%1" == "WS03XP2KPCIE" goto valid

goto invalid

:invalid
echo !!! COMMAND LINE PARAMETERS ARE NOT CORRECT !!!
goto usage

:valid
if NOT "%gui%" == "" goto gui_valid
if "%dest%" == "A:" goto floppy
if "%dest%" == "B:" goto floppy
goto nofloppy

:gui_valid
if %dest% == "A:" goto floppy
if %dest% == "B:" goto floppy
goto nofloppy

:nofloppy
set mode=nofloppy
cls
echo The destination you specified (%dest%) does not
echo appear to be a diskette. If you are trying to create a diskette,
echo press Control-C and answer Y. Then re-enter a command again, be sure
echo to enter the drive letter without a trailing backslash (A: or B:).
echo.
echo If you do want the files copied to %dest%
if "%_silent%" == "FALSE" pause
goto cont_1

:floppy
set mode=floppy
if NOT "%gui%" == "" goto cont_1 
cls
if exist %dest%\*.* echo !! THIS DISKETTE DOES NOT APPEAR TO BE FORMATTED !!
echo.
echo Please be sure the disk in %dest% is 1.44MB, formatted, non-bootable and
echo has no pre-existing files. To format the diskette, press Control-C
echo and answer Y, then enter the command FORMAT %dest%. Otherwise,
if "%_silent%" == "FALSE" pause
goto cont_1

:cont_1
if not exist ..\..\verfile.tic goto wrongdir

if "%1" == "ws03xp2kgig" set OS1=Intel(R) PRO/1000 Network Connection Configuration
if "%1" == "ws03xp2kgig" Set OS2=Microsoft Windows Server 2003 32 bit and Windows XP/2000
if "%1" == "WS03XP2KGIG" set OS1=Intel(R) PRO/1000 Network Connection Configuration
if "%1" == "WS03XP2KGIG" Set OS2=Microsoft Windows Server 2003 32 bit and Windows XP/2000

if "%1" == "ws03xp2kfe" set OS1=Intel(R) PRO/100 Network Connection Configuration
if "%1" == "ws03xp2kfe" Set OS2=Microsoft Windows Server 2003 32 bit and Windows XP/2000
if "%1" == "WS03XP2KFE" set OS1=Intel(R) PRO/100 Network Connection Configuration
if "%1" == "WS03XP2KFE" Set OS2=Microsoft Windows Server 2003 32 bit and Windows XP/2000

if "%1" == "ws03xp2kpcie" set OS1=Intel(R) PRO/1000 Network Connection Configuration
if "%1" == "ws03xp2kpcie" Set OS2=Microsoft Windows Server 2003 32 bit and Windows XP/2000
if "%1" == "WS03XP2KPCIE" set OS1=Intel(R) PRO/1000 Network Connection Configuration
if "%1" == "WS03XP2KPCIE" Set OS2=Microsoft Windows Server 2003 32 bit and Windows XP/2000

rem ****************************************************************************************************************
rem ******* Inform user of destination directory and begin copying ***************************************************
rem ****************************************************************************************************************

cls
rem Check and see if the directory exists, if not create it.
if exist %dest% goto DIR_OK
md %dest%
:DIR_OK

echo.
echo This batch file will copy the 
echo %OS1% and
echo %OS2% 
echo driver files to: %dest%
echo.
echo press CTRL-C and answer Y if this is NOT correct, otherwise
if "%_silent%" == "FALSE" pause
cls
echo.
echo Copying files to %dest%
echo.

:OSCOPY

if "%1" == "ws03xp2kfe" goto 32FE
if "%1" == "WS03XP2KFE" goto 32FE
if "%1" == "ws03xp2kgig" goto 32GIG
if "%1" == "WS03XP2KGIG" goto 32GIG
if "%1" == "ws03xp2kpcie" goto 32PCIE
if "%1" == "WS03XP2KPCIE" goto 32PCIE

goto USAGE

:32GIG
rem ****************************************************************************************************************
rem     ******************** Start of the Windows Server 2003/XP/2000 section Gigabit drivers **********************
rem ****************************************************************************************************************

copy /v ..\..\PRO1000\WS03XP2K\e1000msg.dll %dest%
copy /v ..\..\PRO1000\WS03XP2K\e1000nt5.din %dest%
copy /v ..\..\PRO1000\WS03XP2K\E1000NT5.SYS %dest%
copy /v ..\..\PRO1000\WS03XP2K\e1000325.cat %dest%
copy /v ..\..\PRO1000\WS03XP2K\e1000325.din %dest%
copy /v ..\..\PRO1000\WS03XP2K\e1000325.inf %dest%
copy /v ..\..\PRO1000\WS03XP2K\E1000325.SYS %dest%
copy /v ..\..\PRO1000\WS03XP2K\EtCoInst.dll %dest%
copy /v ..\..\PRO1000\WS03XP2K\intelnic.dll %dest%
copy /v ..\..\PRO1000\WS03XP2K\PROUnstl.exe %dest%
if not exist %dest%\E1000325.sys goto NOCOPY
goto FINISHED_COPYING

:32PCIE
rem ****************************************************************************************************************
rem     ******************** Start of the Windows Server 2003/XP/2000 section 1000 PCI Express drivers *************
rem ****************************************************************************************************************

copy /v ..\..\PRO1000\WS03XP2K\e1e5032.din %dest%
copy /v ..\..\PRO1000\WS03XP2K\E1e5032.SYS %dest%
copy /v ..\..\PRO1000\WS03XP2K\e1e5132.cat %dest%
copy /v ..\..\PRO1000\WS03XP2K\e1e5132.din %dest%
copy /v ..\..\PRO1000\WS03XP2K\e1e5132.inf %dest%
copy /v ..\..\PRO1000\WS03XP2K\E1e5132.sys %dest%
copy /v ..\..\PRO1000\WS03XP2K\e1000msg.dll %dest%
copy /v ..\..\PRO1000\WS03XP2K\EtCoInst.dll %dest%
copy /v ..\..\PRO1000\WS03XP2K\intelnic.dll %dest%
copy /v ..\..\PRO1000\WS03XP2K\PROUnstl.exe %dest%
if not exist %dest%\E1e5132.sys goto NOCOPY
goto FINISHED_COPYING

:32FE
rem ****************************************************************************************************************
rem     ******************** Start of the Windows Server 2003/XP/2000 section 10/100 drivers ***********************
rem ****************************************************************************************************************

copy /v ..\..\PRO100\WS03XP2K\AsfStup.dll %dest%
copy /v ..\..\PRO100\WS03XP2K\e100a325.inf %dest%
copy /v ..\..\PRO100\WS03XP2K\e100ant5.inf %dest%
copy /v ..\..\PRO100\WS03XP2K\e100b325.cat %dest%
copy /v ..\..\PRO100\WS03XP2K\e100b325.din %dest%
copy /v ..\..\PRO100\WS03XP2K\e100b325.inf %dest%
copy /v ..\..\PRO100\WS03XP2K\e100b325.sys %dest%
copy /v ..\..\PRO100\WS03XP2K\e100bmsg.dll %dest%
copy /v ..\..\PRO100\WS03XP2K\e100bnt5.din %dest%
copy /v ..\..\PRO100\WS03XP2K\e100bnt5.sys %dest%
copy /v ..\..\PRO100\WS03XP2K\intelnic.dll %dest%
copy /v ..\..\PRO100\WS03XP2K\PROUnstl.exe %dest%
if not exist %dest%\e100bnt5.sys goto NOCOPY
goto FINISHED_COPYING

rem ****************************************************************************************************************
rem *********************** End of File Copying ********************************************************************
rem ****************************************************************************************************************

:FINISHED_COPYING

copy /v ..\..\VERFILE.TIC %dest%
if not exist %dest%\VERFILE.TIC goto NOCOPY

echo.
echo Base driver files have been copied to media or path. 
echo Advanced Networking Features must be installed from
echo a CD-ROM drive, or over the network, after a connection
echo to your network file service has been established.
echo.

if NOT "%gui%" == "" set gui=done
if "%_mdisk_floppy%" == "FALSE" goto end
echo PLEASE LABEL YOUR DISKETTE
echo %OS1% and
echo %OS2%
echo Drivers (Release # from your CD)
echo.
goto end

:env_bad
set env_chk=
cls
echo ERROR: Your computer does not have sufficient environment space to
echo run this batch file. Please increase the available environment space
echo and run this batch file again. To increase the avaiable environment
echo space, please do the following;
echo.
echo                                  DOS
echo If you are running DOS, edit the CONFIG.SYS file and find the statement
echo COMMAND=C:\(PATH)\COMMAND.COM /e:(number)
echo where (path) is the directory path to your COMMAND.COM file and (number)
echo is a numerical value. Increase the numerical value by at least 32.
echo If this line does not exist, add the following line;
echo COMMAND=C:\COMMAND.COM /E:512
echo Reboot the computer before running this batch file again.
echo.
echo                        Windows 2000 and Windows NT
echo Click Start, then Run, then enter "CMD /E:4096" (without the quotes) to
echo open a DOS window, and then re-run this batch file in that window.
echo.
echo                    Windows 95, Windows 98 and Windows ME
echo Click Start, then Run, then enter "COMMAND /E:4096" (without the quotes) to
echo open a DOS window, and then re-run this batch file in that window.
goto end

:WRONGDIR
if NOT "%gui%" == "" set gui=wrongdir
if NOT "%gui%" == "" goto end
cls
echo You must run this utility from the \MAKEDISK directory.
goto usage

:NOCOPY
if NOT "%gui%" == "" set gui=nocopy
if NOT "%gui%" == "" goto end
cls
echo.
echo Can not copy to %dest%.
echo Please check your syntax and try again
goto usage

:usage
echo.
echo usage rules:
echo MAKE2KXP [operating system] [destination (optional)] [silent (optional)]
echo.
echo [operating system] = OS family you are creating the diskette for
echo WS03XP2KFE         = Microsoft Windows Server 2003/XP/2000 10/100 solution
echo WS03XP2KGIG        = Microsoft Windows Server 2003/XP/2000 Gigabit solution
echo WS03XP2KPCIE       = Microsoft Windows Server 2003/XP/2000 PCI Express solution
echo [destination]      = drive letter and path (Default A:)
echo [silent]           = silent mode (does not pause for user input)
echo.
pause
echo.
echo NOTE:  Do not add a trailing backslash (\) to the destination path.
echo This utility MUST be run from the .\APPS\MAKEDISK directory.
echo.
echo EXAMPLE:
echo To create a Windows XP install diskette in A: for an Intel(R)/100 PRO LAN
echo Adapter Connection, from the MAKEDISK directory run: MAKE2KXP WS03XP2KFE    
echo.
pause
goto END
										   
:END
set dest=
set mode=
set _silent=
set _mdisk_floppy=
if "%gui%" == "" goto CLI_EXIT

REM FINISH_ALL
if NOT "%gui%" == "done" goto GUI_INSERTSECOND
echo 0 > %TEMP%\makediskoutput.txt
cls
exit 0

:GUI_INSERTSECOND
if NOT "%gui%" == "insertsecond" goto GUI_NOCOPY
echo 6 > %TEMP%\makediskoutput.txt
cls
exit 6

:GUI_NOCOPY
if NOT "%gui%" == "nocopy" goto GUI_WRONGDIR
echo 2 > %TEMP%\makediskoutput.txt
cls
exit 2

:GUI_WRONGDIR
if NOT "%gui%" == "wrongdir" goto GUI_GENFAILURE
echo 8 > %TEMP%\makediskoutput.txt
cls
exit 8

:GUI_GENFAILURE
echo 9 > %TEMP%\makediskoutput.txt
cls
exit 9

:CLI_EXIT


