clivebuckwheat Posted July 28, 2011 Posted July 28, 2011 (edited) getting unexpected end error, and I really can't see why.:* @echo offcd /d %~dp0if "%pi_netOS%" == "" call piParms.cmdif exist C:\reboot.1 goto :rb1IF "%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)rb1rundll32.exe iernonce.dll,RunOnceExProcessSET pi_KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceExREG ADD %pi_KEY% /fREG ADD %pi_KEY% /V TITLE /D "Installing Applications & Settings" /fset pi_roomNum=%computerName:~0,-3%set pi_stnNum=%computerName:~-2%call :%pi_roomNum% 2>nulgoto :genericLab:* -----------------------------------------------------------------------------------:1H1-1call :LanSchool 111call :printersgoto :EOF:* -----------------------------------------------------------------------------------:2F14call :LanSchool 14call :printers 2F14P 2H12P-CLRgoto :EOF:* -----------------------------------------------------------------------------------:2F18call :LanSchool 18call :printers 2F18P 2H12P-CLR:* %pi_KEY%\s go from 100 to 200call C:\Applications\CS4\setupCS4inMenu.cmdgoto :EOF:* -----------------------------------------------------------------------------------:2F24call :LanSchool 24call :printers 2F24P 2H12P-CLR:* %pi_KEY%\s go from 100 to 200call C:\Applications\CS4\setupCS4inMenu.cmdgoto :EOF:* -----------------------------------------------------------------------------------:2F26call :LanSchool 26call :printers 2F26P 2H12P-CLR:* %pi_KEY%\s go from 100 to 200REM call C:\Applications\CS3\setupCS3inMenu.cmdgoto :EOF:* -----------------------------------------------------------------------------------REM final steps:genericLabrundll32.exe iernonce.dll,RunOnceExProcessmove /y C:\Applications\sdelete.exe C:\Windows\System32reg ADD "HKCU\Software\Sysinternals\SDelete" /v EulaAccepted /t REG_DWORD /d 1 /fIF "%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.exemove C:\Applications\DeepFreeze\DFWks.exe C:\Windowsrd /s /q C:\Applicationsmd C:\ApplicationsDFWks.exe /Installgoto :out:* -----------------------------------------------------------------------------------:outpausegoto :EOF:* ===================================================================================:LanSchoolREG ADD %pi_KEY%\050 /VE /D "Installing LanSchool Student 7.4.2.2 on channel %1%" /fREG ADD %pi_KEY%\050 /V 1 /D "msiexec.exe /i C:\Applications\LanSchool\Student.msi /qn CHANNEL=%1%" /fgoto :EOF:* -----------------------------------------------------------------------------------:printersREM set the "Default" printercscript %windir%\system32\Printing_Admin_Scripts\en-us\prnmngr.vbs -t -p "\\ipp://dc2\%1%"REM printers to deleteif "%1" NEQ "2F14P" if "%2" NEQ "2F14P" call :delPrn 2F14Pif "%1" NEQ "2F16P" if "%2" NEQ "2F16P" call :delPrn 2F16Pif "%1" NEQ "2F18P" if "%2" NEQ "2F18P" call :delPrn 2F18Pif "%1" NEQ "2F20P" if "%2" NEQ "2F20P" call :delPrn 2F20Pif "%1" NEQ "2F24P" if "%2" NEQ "2F24P" call :delPrn 2F24Pif "%1" NEQ "2F26P" if "%2" NEQ "2F26P" call :delPrn 2F26Pif "%1" NEQ "2H12P-CLR" if "%2" NEQ "2H12P-CLR" call :delPrn 2H12P-CLRgoto :EOF:* -----------------------------------------------------------------------------------:delPrnreg delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers\,,ipp://dc2,%1%" /fgoto :EOF:* -----------------------------------------------------------------------------------:2F16goto :EOF:5B1goto :EOF:5B2goto :EOF:5B3goto :EOF:5B4goto :EOF:5B7goto :EOFHere is the PiParms.cmd filehere is the piparms.cmdset pi_netOS=ADreg query HKLM\SOFTWARE\Novell\Login /ve >nul 2>nulif errorlevel 1 goto :netOSokset pi_netOS=NW:netOSok Edited July 28, 2011 by Tripredacus code tags plz
Tripredacus Posted July 28, 2011 Posted July 28, 2011 Your piparms.cmd has an option to go to :ntOsok but there is nothing in that section.Also, not sure, do you need to actually define something for :EOF or is that a built in function?
Yzöwl Posted July 28, 2011 Posted July 28, 2011 I'd suggest you begin by changing all lines containing comments to begin with either :: or REM as opposed to :*
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now