-------------------------------
REM Initiate.cmd
@Echo Off
REM Call file to map drives
REM And that file calls the install file
call c:\install\map.cmd
REM Remove the install directory
rmdir /s /q c:\INSTALL
REM Reboot the computer
c:\shutdown -f -r -t 45
Exit
----------------------------------
REM Map.cmd
ECHO Off
REM Map drive to Deep Freeze Install Share
net use s: \\s047-s0371-01\deepfreezeinstall$ /user:cssdstu\username
secretpassword
REM Map drive to install files
net use t: \\s047-s0371-01\047progs$ /user:cssdstu\username secretpassword
call c:\install\install.cmd
REM Disconnect network mappings
net use s: /d /y
net use t: /d /y
REM Return control back to the initiate.bat file outside of the c:\install
folder
REM so that the c:\install folder can be deleted
Exit
-------------------------------------
REM Install.cmd
@Echo Off
REM Batch file to install programs after an unattended install
REM Check to see if the computer is XP or W2K
ver | find "XP" > nul
if %ERRORLEVEL% == 0 goto CTSORC309
ver | find "2000" > nul
if %ERRORLEVEL% == 0 goto IE6FULLINSTALL
:IE6FULLINSTALL
REM Install the full IE6, suppressing the reboot
REM An eventual reboot will be necessary for IE6 to work properly
REM This install must be local. It cannot be run over the network.
ECHO This is a Windows 2000 computer.
ECHO So Internet Explorer must be updated.
ECHO Please wait while Internet Exploere 6 is installed...
start /wait c:\install\ie6\ie6setup.exe /Q:A
goto STAPLEINSTALLS
:CTSORC309
REM Determine if the computer is in the CTS lab or C309 lab
REM and install programs accordingly
If /i "%Compuername:~0,7%" EQU "047-CTS" goto CTSINSTALLS
If /i "%Compuername:~0,8%" EQU "047-C309" goto C309INSTALLS
:CTSINSTALLS
REM Programs to be installed on the CTS computers will go here
goto STAPLEINSTALLS
:C309
REM Programs to be installed on the C309 computers will go here
goto STAPLEINSTALLS
:STAPLEINSTALLS
REM Install Recovery Console on the target PC.
REM start /wait c:\i386\winnt32.exe /cmdcons /unattend
REM Rename the local administrator account and randomize the password
password
REM start /wait t:\install\cusrmgr.exe -u Administrator -r strawberry -p
REM Do the above with Builtin.exe until I can find a copy of cusrmgr.exe
ECHO Changing the local administrator account name and password
ECHO Please wait...
start /wait t:\install\builtin.exe /newname:strawberry3939l33@#$
/newpw:dsaf083k1%&
REM This batch file deletes the Default User directory and subdirectories,
REM recreates it, and then unzips profile.zip into the Default User
directory.
REM Note: the program unzip.exe is used to unzip profile.zip. Unzip.exe
REM supports long folder and file names and will run in a WinXP/2000 command
REM line environment. The GUI based zip/unzip programs do not have a stand
alone
REM command line program for zipping and unzipping.
REM And the old standby, PKUNZIP, will not work in Win2000/XP.
ECHO Replacing the current Default User profile with a custom Default User
Profile
ECHO Please wait...
if exist "c:\Documents and Settings\Default User" rd /s/q "c:\Documents and
Settings\Default User"
t:\install\sleep 10
t:\install\unzip.exe t:\install\profile.zip -d "C:\Documents and Settings"
REM Add global CSSDSTU accounts/groups to the local administrators group
ECHO Adding CSSDSTU accounts and groups to the lcoal adminstrators group
ECHO Please wait...
net localgroup administrators cssdstu\gg047-students /add
net localgroup administrators cssdstu\047installer.student /add
net localgroup administrators jer...@student.cssd.ab.ca /add
REM Add global CSSDADMIN accounts/groups to the local administrators group
ECHO Adding global CSSDADMIN accounts and groups to the local administrators
group
net localgroup administrators cssdadmin\gg047-tech /add
net localgroup administrators cssdadmin\gg922-techservices /add
net localgroup administrators cssdadmin\gg922-sanalyst /add
net localgroup administrators cssdadmin\gg922-helpdesk /add
REM Install File Disk (Program used to mount ISO files)
ECHO Installing FileDisk so the computer can mount ISO images
ECHO Please wait...
REM Copy the driver (filedisk.sys) to %systemroot%\system32\drivers\.
copy t:\filedisk\filedisk.sys %systemroot%\system32\drivers\
REM Copy filedisk.exe to %systemroot%
copy t:\filedisk\filedisk.exe %systemroot%
REM Optionally edit filedisk.reg for automatic/manually start and number of
devices.
REM Import filedisk.reg to the Registry.
REGEDIT /S t:\filedisk\filedisk.reg
REM Will require a reboot (done at end of this file) for it to work properly
REM Install DameWare Mini Remote Control Service
ECHO Installing Dameware Mini Remote Control Service
ECHO Please wait...
start /wait t:\dameware\DWRCSInstall.exe
REM Installing Adobe Reader 8
ECHO Installing Adobe Reader 8
ECHO Please wait...
start /wait t:\adobe\adobe8.exe /sPB /rs /l /msi"/qb-! /norestart /log
c:\acrobat8.log ALLUSERS=2 EULA_ACCEPT=YES SUPPRESS_APP_LAUNCH=YES"
ECHO Install Office 2003 (using Grandin student MST file)
ECHO Installing Office 2003
ECHO Please wait...
start /wait t:\office2003\setuppro.exe
TRANSFORMS=t:\office2003\office2003student.MST /qb-
REM Install FireFox 2.0
ECHO Installing FireFox 2.0
ECHO Please wait...
start /wait t:\firefox\firefox2.exe -ms -ira
REM Install KixForms 4.6 (used to make login scripts a bit fancier)
ECHO Installing KixForms 4.6
ECHO Please wait...
start /wait t:\kixforms46\kixforms.msi /q
REM Install IndentD Service (allows student tracking on IPCOP)
ECHO Installing the IDENTD Service
ECHO Please wait...
start /wait c:\identd\bin\identd.exe -install
REM Starting the identd service
ECHO Starting the IDENTD service
ECHO Please wait...
Net Start identd
REM Installing All The Right Type
ECHO Installing All The Right Type
ECHO Please wait...
xcopy "t:\All The Right Type 3 Student" "C:\Program Files\All the Right Type
3 Student\" /y /h /s /e
copy "t:\All The Right Type 3\student.iw" c:\windows\ /y
REM Set the default domain logon to CSSDSTU
ECHO Modifying registry so the computer will default to CSSDSTU
ECHO Please wait...
REGEDIT /S t:\install\defaultdomain.reg
REM Install Deep Freeze 6.0
REM The install line below will force no reboot with the install
ECHO Installing Deep Freeze 6.0
ECHO Please wait...
S:\seanixDF6WKs.exe /install /noreboot
REM Return control back to c:\install\map.cmd
Exit
--------------------------------------------
You could add 'EXIT /B 1' for the 1st script then 'EXIT /B 2' for the 2nd etc.
Then you could use 'ECHO %ERRORLEVEL% after the CALL statement to check that subscript was executed.
To narrow down the error further just inject extra 'ECHO ...' statements before & after a potential
error condition - maybe before a package install & then after to see you get both ECHO's okay.
I found this simple approach can quickly narrow down the location of where the script 'blows up'.
I ike that piping:-
>ver | find "XP" > nul
>if %ERRORLEVEL% == 0 goto CTSORC309
Will use this in my scripts :)
START /W c:\shutdown -f -r -t 45
>Exit
>
START /W t:\install\sleep 10
START /W t:\install\unzip.exe t:\install\profile.zip -d "C:\Documents and Settings"
>
>REM Add global CSSDSTU accounts/groups to the local administrators group
>ECHO Adding CSSDSTU accounts and groups to the lcoal adminstrators group
>ECHO Please wait...
START /W net localgroup administrators cssdstu\gg047-students /add
START /W net localgroup administrators cssdstu\047installer.student /add
START /W net localgroup administrators jer...@student.cssd.ab.ca /add
>
>REM Add global CSSDADMIN accounts/groups to the local administrators group
>ECHO Adding global CSSDADMIN accounts and groups to the local administrators
>group
START /W net localgroup administrators cssdadmin\gg047-tech /add
START /W net localgroup administrators cssdadmin\gg922-techservices /add
START /W net localgroup administrators cssdadmin\gg922-sanalyst /add
START /W net localgroup administrators cssdadmin\gg922-helpdesk /add
>
>REM Install File Disk (Program used to mount ISO files)
>ECHO Installing FileDisk so the computer can mount ISO images
>ECHO Please wait...
>REM Copy the driver (filedisk.sys) to %systemroot%\system32\drivers\.
>copy t:\filedisk\filedisk.sys %systemroot%\system32\drivers\
>REM Copy filedisk.exe to %systemroot%
>copy t:\filedisk\filedisk.exe %systemroot%
>REM Optionally edit filedisk.reg for automatic/manually start and number of
>devices.
>REM Import filedisk.reg to the Registry.
START /W REGEDIT /S t:\filedisk\filedisk.reg
START /W Net Start identd
>
>REM Installing All The Right Type
>ECHO Installing All The Right Type
>ECHO Please wait...
START /W xcopy "t:\All The Right Type 3 Student" "C:\Program Files\All the Right Type
3 Student\" /y /h /s /e
>copy "t:\All The Right Type 3\student.iw" c:\windows\ /y
>
>REM Set the default domain logon to CSSDSTU
>ECHO Modifying registry so the computer will default to CSSDSTU
>ECHO Please wait...
START /W REGEDIT /S t:\install\defaultdomain.reg
>
>REM Install Deep Freeze 6.0
>REM The install line below will force no reboot with the install
>ECHO Installing Deep Freeze 6.0
>ECHO Please wait...
START /W S:\seanixDF6WKs.exe /install /noreboot
I added some more 'START /W ' commands - probably important to wait for those large package
installs for firefox, adobe, etc.
You could add 'EXIT /B 1' for the 1st script then 'EXIT /B 2' for the 2nd etc.
Then you could use 'ECHO %ERRORLEVEL% after the CALL statement to check that subscript was executed.
To narrow down the error further just inject extra 'ECHO ...' statements before & after a potential
error condition - maybe before a package install & then after to see you get both ECHO's okay.
I found this simple approach can quickly narrow down the location of where the script 'blows up'.
I ike that piping:-
>ver | find "XP" > nul
>if %ERRORLEVEL% == 0 goto CTSORC309
Will use this in my scripts :)
On Sun, 01 Apr 2007 03:02:18 GMT, "Jeremy" <js...@hotmail.com> wrote:
ECHO. & ECHO ##### map.cmd errorlevel is ... %ERRORLEVEL% ##### & ECHO.
>REM Remove the install directory
>rmdir /s /q c:\INSTALL
>REM Reboot the computer
START /W c:\shutdown -f -r -t 45
>Exit
>
>----------------------------------
>REM Map.cmd
>ECHO Off
>REM Map drive to Deep Freeze Install Share
START /W net use s: \\s047-s0371-01\deepfreezeinstall$ /user:cssdstu\username
secretpassword
>REM Map drive to install files
START /W net use t: \\s047-s0371-01\047progs$ /user:cssdstu\username secretpassword
>call c:\install\install.cmd
ECHO. & ECHO ##### install.cmd errorlevel is ... %ERRORLEVEL% ##### & ECHO.
>REM Disconnect network mappings
START /W net use s: /d /y
START /W net use t: /d /y
>REM Return control back to the initiate.bat file outside of the c:\install
>folder
>REM so that the c:\install folder can be deleted
EXIT /B 1
>
>ver | find "2000" > nul
goto :STAPLEINSTALLS
goto :STAPLEINSTALLS
>
:C309INSTALLS
goto :STAPLEINSTALLS
START /W t:\install\sleep 10
START /W t:\install\unzip.exe t:\install\profile.zip -d "C:\Documents and Settings"
>
>REM Add global CSSDSTU accounts/groups to the local administrators group
>ECHO Adding CSSDSTU accounts and groups to the lcoal adminstrators group
>ECHO Please wait...
START /W net localgroup administrators cssdstu\gg047-students /add
START /W net localgroup administrators cssdstu\047installer.student /add
START /W net localgroup administrators jer...@student.cssd.ab.ca /add
>
>REM Add global CSSDADMIN accounts/groups to the local administrators group
>ECHO Adding global CSSDADMIN accounts and groups to the local administrators
>group
START /W net localgroup administrators cssdadmin\gg047-tech /add
START /W net localgroup administrators cssdadmin\gg922-techservices /add
START /W net localgroup administrators cssdadmin\gg922-sanalyst /add
START /W net localgroup administrators cssdadmin\gg922-helpdesk /add
>
>REM Install File Disk (Program used to mount ISO files)
>ECHO Installing FileDisk so the computer can mount ISO images
>ECHO Please wait...
>REM Copy the driver (filedisk.sys) to %systemroot%\system32\drivers\.
>copy t:\filedisk\filedisk.sys %systemroot%\system32\drivers\
>REM Copy filedisk.exe to %systemroot%
>copy t:\filedisk\filedisk.exe %systemroot%
>REM Optionally edit filedisk.reg for automatic/manually start and number of
>devices.
>REM Import filedisk.reg to the Registry.
START /W REGEDIT /S t:\filedisk\filedisk.reg
START /W Net Start identd
>
>REM Installing All The Right Type
>ECHO Installing All The Right Type
>ECHO Please wait...
START /W xcopy "t:\All The Right Type 3 Student" "C:\Program Files\All the Right Type
3 Student\" /y /h /s /e
>copy "t:\All The Right Type 3\student.iw" c:\windows\ /y
>
>REM Set the default domain logon to CSSDSTU
>ECHO Modifying registry so the computer will default to CSSDSTU
>ECHO Please wait...
START /W REGEDIT /S t:\install\defaultdomain.reg
>
>REM Install Deep Freeze 6.0
>REM The install line below will force no reboot with the install
>ECHO Installing Deep Freeze 6.0
>ECHO Please wait...
START /W S:\seanixDF6WKs.exe /install /noreboot
>
>REM Return control back to c:\install\map.cmd
EXIT /B 2
>--------------------------------------------