@echo off

REM Create Folder Structures before Copying Files
if exist "c:\Program Files\SchoolsTools" goto ST1
mkdir "c:\Program Files\SchoolsTools"
:ST1
if exist "c:\Program Files\SchoolsTools\Control8" goto ST2
mkdir "c:\Program Files\SchoolsTools\Control8"
:ST2
copy "Control8.exe" "c:\Program Files\SchoolsTools\Control8"
copy "Icon.ico" "c:\Program Files\SchoolsTools\Control8"
copy "HowToUse.pdf" "c:\Program Files\SchoolsTools\Control8"
copy "maps.txt" "c:\Program Files\SchoolsTools\Control8"
copy "map1.txt" "c:\Program Files\SchoolsTools\Control8"
copy "map2.txt" "c:\Program Files\SchoolsTools\Control8"
copy "map3.txt" "c:\Program Files\SchoolsTools\Control8"
copy "map4.txt" "c:\Program Files\SchoolsTools\Control8"
copy "map5.txt" "c:\Program Files\SchoolsTools\Control8"
copy "map6.txt" "c:\Program Files\SchoolsTools\Control8"
copy "map7.txt" "c:\Program Files\SchoolsTools\Control8"
copy "map8.txt" "c:\Program Files\SchoolsTools\Control8"
copy "map9.txt" "c:\Program Files\SchoolsTools\Control8"
copy "map10.txt" "c:\Program Files\SchoolsTools\Control8"
copy "map11.txt" "c:\Program Files\SchoolsTools\Control8"
copy "map12.txt" "c:\Program Files\SchoolsTools\Control8"
copy "map13.txt" "c:\Program Files\SchoolsTools\Control8"
copy "map14.txt" "c:\Program Files\SchoolsTools\Control8"

ver | find "2000" > nul
if %ERRORLEVEL% == 0 goto W2KXP

ver | find "XP" > nul
if %ERRORLEVEL% == 0 goto W2KXP

if not exist %SystemRoot%\system32\systeminfo.exe goto notFound

systeminfo | find "OS Name" > %TEMP%\osname.txt
FOR /F "usebackq delims=: tokens=2" %%i IN (%TEMP%\osname.txt) DO set vers=%%i

echo %vers% | find "Windows Vista" > nul
if %ERRORLEVEL% == 0 goto WV7

echo %vers% | find "Windows 7" > nul
if %ERRORLEVEL% == 0 goto WV7

goto notFound

:W2KXP
REM Create Folder Structures before Copying Files
if exist "c:\Documents and Settings\All Users\Start Menu\Programs\Schools Tools" goto ST3
mkdir "c:\Documents and Settings\All Users\Start Menu\Programs\Schools Tools"
:ST3
if exist "c:\Documents and Settings\All Users\Start Menu\Programs\Schools Tools\Control 8" goto ST4
mkdir "c:\Documents and Settings\All Users\Start Menu\Programs\Schools Tools\Control 8"
:ST4
copy "Control 8.lnk" "c:\Documents and Settings\All Users\Start Menu\Programs\Schools Tools\Control 8"
copy "HowToUse.lnk" "c:\Documents and Settings\All Users\Start Menu\Programs\Schools Tools\Control 8"

goto ending

:WV7
REM Create Folder Structures before Copying Files
if exist "c:\ProgramData\Microsoft\Windows\Start Menu\Programs\Schools Tools" goto ST5
mkdir "c:\ProgramData\Microsoft\Windows\Start Menu\Programs\Schools Tools"
:ST5
if exist "c:\ProgramData\Microsoft\Windows\Start Menu\Programs\Schools Tools\Control 8" goto ST6
mkdir "c:\ProgramData\Microsoft\Windows\Start Menu\Programs\Schools Tools\Control 8"
:ST6
copy "Control 8.lnk" "c:\ProgramData\Microsoft\Windows\Start Menu\Programs\Schools Tools\Control 8"
copy "HowToUse.lnk" "c:\ProgramData\Microsoft\Windows\Start Menu\Programs\Schools Tools\Control 8"

:ending
echo Installation Complete!
pause