Jump to content

Unexpected end when running this script. What is wrong with it?


Recommended Posts

getting unexpected end error, and I really can't see why.

:* @echo off
cd /d %~dp0

if "%pi_netOS%" == "" call piParms.cmd
if exist C:\reboot.1 goto :rb1

IF "%pi_netOS%" == "NW" (
reg ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DefaultDomainName /d %computername% /f
:* start postImage.cmd.lnk
) ELSE (
echo running AD > C:\reboot.1
move postImage.cmd.lnk "%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs\Startup\"
netdom join %computerName% /Domain:mydomain/UserD:postimager /PasswordD:mypassword /REBoot:5
echo.
echo Computer will soon reboot...
pause
)

rb1
rundll32.exe iernonce.dll,RunOnceExProcess
SET pi_KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx
REG ADD %pi_KEY% /f
REG ADD %pi_KEY% /V TITLE /D "Installing Applications & Settings" /f

set pi_roomNum=%computerName:~0,-3%
set pi_stnNum=%computerName:~-2%
call :%pi_roomNum% 2>nul
goto :genericLab

:* -----------------------------------------------------------------------------------

:1H1-1
call :LanSchool 111
call :printers
goto :EOF

:* -----------------------------------------------------------------------------------

:2F14
call :LanSchool 14
call :printers 2F14P 2H12P-CLR
goto :EOF

:* -----------------------------------------------------------------------------------

:2F18
call :LanSchool 18
call :printers 2F18P 2H12P-CLR

:* %pi_KEY%\s go from 100 to 200
call C:\Applications\CS4\setupCS4inMenu.cmd
goto :EOF

:* -----------------------------------------------------------------------------------

:2F24
call :LanSchool 24
call :printers 2F24P 2H12P-CLR

:* %pi_KEY%\s go from 100 to 200
call C:\Applications\CS4\setupCS4inMenu.cmd
goto :EOF

:* -----------------------------------------------------------------------------------

:2F26
call :LanSchool 26
call :printers 2F26P 2H12P-CLR

:* %pi_KEY%\s go from 100 to 200
REM call C:\Applications\CS3\setupCS3inMenu.cmd

goto :EOF

:* -----------------------------------------------------------------------------------

REM final steps
:genericLab
rundll32.exe iernonce.dll,RunOnceExProcess

move /y C:\Applications\sdelete.exe C:\Windows\System32
reg ADD "HKCU\Software\Sysinternals\SDelete" /v EulaAccepted /t REG_DWORD /d 1 /f

IF "%pi_netOS%" == "NW" (
reg ADD "HKLM\SOFTWARE\Novell\Login" /v AutoAdminQueryNDS /t REG_DWORD /d 1 /f
) ELSE (
REM running AD
reg ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v AutoAdminLogon /d 0 /f
del "%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs\Startup\postImage.cmd.lnk"
)

SET pi_KEY=
set pi_roomNum=
set pi_stnNum=
set pi_netOS=

:* sdelete.exe -p 6 C:\...\Auth.exe
move C:\Applications\DeepFreeze\DFWks.exe C:\Windows
rd /s /q C:\Applications
md C:\Applications

DFWks.exe /Install
goto :out

:* -----------------------------------------------------------------------------------

:out
pause
goto :EOF

:* ===================================================================================

:LanSchool
REG ADD %pi_KEY%\050 /VE /D "Installing LanSchool Student 7.4.2.2 on channel %1%" /f
REG ADD %pi_KEY%\050 /V 1 /D "msiexec.exe /i C:\Applications\LanSchool\Student.msi /qn CHANNEL=%1%" /f
goto :EOF

:* -----------------------------------------------------------------------------------

:printers
REM set the "Default" printer
cscript %windir%\system32\Printing_Admin_Scripts\en-us\prnmngr.vbs -t -p "\\ipp://dc2\%1%"

REM printers to delete
if "%1" NEQ "2F14P" if "%2" NEQ "2F14P" call :delPrn 2F14P
if "%1" NEQ "2F16P" if "%2" NEQ "2F16P" call :delPrn 2F16P
if "%1" NEQ "2F18P" if "%2" NEQ "2F18P" call :delPrn 2F18P
if "%1" NEQ "2F20P" if "%2" NEQ "2F20P" call :delPrn 2F20P
if "%1" NEQ "2F24P" if "%2" NEQ "2F24P" call :delPrn 2F24P
if "%1" NEQ "2F26P" if "%2" NEQ "2F26P" call :delPrn 2F26P
if "%1" NEQ "2H12P-CLR" if "%2" NEQ "2H12P-CLR" call :delPrn 2H12P-CLR
goto :EOF

:* -----------------------------------------------------------------------------------

:delPrn
reg delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers\,,ipp://dc2,%1%" /f
goto :EOF

:* -----------------------------------------------------------------------------------

:2F16
goto :EOF

:5B1
goto :EOF

:5B2
goto :EOF

:5B3
goto :EOF

:5B4
goto :EOF

:5B7
goto :EOF

Here is the PiParms.cmd file

here is the piparms.cmd

set pi_netOS=AD
reg query HKLM\SOFTWARE\Novell\Login /ve >nul 2>nul
if errorlevel 1 goto :netOSok
set pi_netOS=NW
:netOSok

Edited by Tripredacus
code tags plz
Link to comment
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...