@echo off REM Dit script is geschreven door Jorn Michielsen van IT-Value voor VNOG setlocal enableextensions REM Maniertje om admin rights te kijken echo a > %SYSTEMROOT%\system32\adminrights if %ERRORLEVEL%==0 goto :start if %ERRORLEVEL% GEQ 1 goto :end :start del %SYSTEMROOT%\system32\adminrights cd /d "%~dp0" echo Het script wordt momenteel uitvoerd vanuit "%CD%" ver | findstr /i "5\.1\." > nul IF %ERRORLEVEL% EQU 0 set OS_=XP & goto :powershell ver | findstr /i "6\.1\." > nul IF %ERRORLEVEL% EQU 0 set OS_=7 & goto :framework45 echo Script wordt geannuleerd.. werkt alleen voor Windows XP SP3 en Windows 7 pause exit :framework45 if %OS_%==7 echo Besturingssysteem is Windows 7 echo .NET Framework 4.0 installeren... "%CD%\installs\dotnetfx40.exe" /passive /norestart if %ERRORLEVEL%==0 echo OK if %ERRORLEVEL% GEQ 1 echo FAIL goto :hostname :powershell if %OS_%==XP echo Besturingssysteem is Windows XP REM echo .NET Framework 3.5.1 installeren... REM ipconfig /release > nul REM echo Internet verbinding tijdelijk verbreken voor .NET Framework 3.5.1 REM "%CD%\installs\dotnetfx35.exe" /qb /norestart "%CD%\installs\dotnetfx35setup.exe" if %ERRORLEVEL%==0 echo OK if %ERRORLEVEL% GEQ 1 echo FAIL ping 127.0.0.1 -n 5 -w 1000 > nul echo Windows installatie taal nakijken.. reg query "hklm\system\controlset001\control\nls\language" /v Installlanguage > %temp%\jornscript if %ERRORLEVEL%==0 echo OK if %ERRORLEVEL% GEQ 1 echo FAIL find "0409" %TEMP%\jornscript > nul if %ERRORLEVEL%==0 set taal=ENG && goto :PSeng if %ERRORLEVEL% GEQ 1 set taal=NLD && goto :PSnld :PSnld echo Powershell 2.0 NLD installeren... "%CD%\installs\WindowsXP-KB968930-x86-NLD.exe" /passive /norestart if %ERRORLEVEL%==0 echo OK if %ERRORLEVEL% GEQ 1 echo FAIL ping 127.0.0.1 -n 5 -w 1000 > nul goto :powershell1 :PSeng echo Powershell 2.0 ENG installeren... "%CD%\installs\WindowsXP-KB968930-x86-ENG.exe" /passive /norestart if %ERRORLEVEL%==0 echo OK if %ERRORLEVEL% GEQ 1 echo FAIL ping 127.0.0.1 -n 5 -w 1000 > nul goto :powershell1 :powershell1 echo Paar Windows variabelen updaten om powershell te kunnen laden set PSModulePath=C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules if %ERRORLEVEL%==0 echo OK if %ERRORLEVEL% GEQ 1 echo FAIL set PATH=%PATH%;%SYSTEMROOT%\system32\WindowsPowerShell\v1.0 if %ERRORLEVEL%==0 echo OK if %ERRORLEVEL% GEQ 1 echo FAIL echo Powershell scripts toestaan if %ERRORLEVEL%==0 echo OK if %ERRORLEVEL% GEQ 1 echo FAIL goto :hostname :hostname powershell Set-ExecutionPolicy Unrestricted echo De huidige hostname is %COMPUTERNAME% set /P HN1=Wilt u de bovenstaande hostname wijzigen? (J/N) if %HN1%==J goto :hostname1 if %HN1%==j goto :hostname1 if %HN1%==N goto :wininstall if %HN1%==n goto :wininstall goto :end :hostname1 set /P hostnamenew=Wat moet de nieuwe hostname worden? set /P HN2=De ingevulde hostname is %hostnamenew%, is dit correct? (J/N) if %HN2%==J goto :hostname2 if %HN2%==j goto :hostname2 if %HN2%==N goto :end if %HN2%==n goto :end goto :end :hostname2 set %COMPUTERNAME%=%hostnamenew% powershell ".\scripts\renhostname.ps1" %hostnamenew% > nul if %ERRORLEVEL%==0 echo Computernaam is nu aangepast naar %hostnamenew% && goto :wininstall if %ERRORLEVEL% GEQ 0 echo FAIL && goto :wininstall :wininstall if %OS_%==7 goto :changepwd if %OS_%==XP echo Windows Installer 4.5 installeren if %taal%==NLD "%CD%\installs\WindowsXP-KB942288-v3-x86-NLD.exe" /passive /norestart if %ERRORLEVEL%==0 echo OK && goto :changepwd if %ERRORLEVEL% GEQ 1 echo FAIL && goto :changepwd if %taal%==ENG "%CD%\installs\WindowsXP-KB942288-v3-x86-ENG.exe" /passive /norestart if %ERRORLEVEL%==0 echo OK && goto :changepwd if %ERRORLEVEL% GEQ 1 echo FAIL && goto :changepwd goto :changepwd :changepwd echo Administrator user op actief zetten net user Administrator /active:yes > nul if %ERRORLEVEL%==0 echo OK if %ERRORLEVEL% GEQ 1 echo FAIL echo Administrator user wachtwoord veranderen net user Administrator Vn0gIct!09 > nul if %ERRORLEVEL%==0 echo OK if %ERRORLEVEL% GEQ 1 echo FAIL echo Gebruiker wachtwoord wijzigen net user Gebruiker Brandweer01 > nul if %ERRORLEVEL%==0 echo OK if %ERRORLEVEL% GEQ 1 echo FAIL goto :installoffice :installoffice echo Office 2010 installeren... "%CD%\installs\2010\setup.exe" /adminfile .\Updates\VNOG.msp if %ERRORLEVEL%==0 echo OK && goto :remcitrix if %ERRORLEVEL% GEQ 1 echo FAIL & goto :remcitrix goto :remcitrix :remcitrix echo Citrix verwijderen... "%CD%\installs\CitrixOnlinePluginWeb.exe" /uninstall if %ERRORLEVEL%==0 echo OK && goto :installcitrix if %ERRORLEVEL% GEQ 1 echo FAIL & goto :end goto :installcitrix :installcitrix echo Citrix installeren... "%CD%\installs\CitrixReceiverEnterprise.exe" /silent /IncludeSSON ENABLE_SSON=yes ADDLOCAL=ReceiverInside,ICA_Client,SSON,AM,SELFSERVICE,USB,DesktopViewer,Flash,Vd3d /ALLOWADDSTORE=N /ENABLE_DYNAMIC_CLIENT_NAME=yes if %ERRORLEVEL%==0 echo OK & goto :remmcafee if %ERRORLEVEL% GEQ 1 echo FAIL & goto :remmcafee pause :remmcafee echo McAfee verwijderen... msiexec /x {147BCE03-C0F1-4C9F-8157-6A89B6D2D973} REMOVE=ALL /qb /norestart if %ERRORLEVEL%==0 echo OK & goto :installsymantec if %ERRORLEVEL% GEQ 1 echo FAIL && goto :installsymantec goto :end :installsymantec echo Symantec installeren... if %PROCESSOR_ARCHITECTURE%==x86 echo x86 Windows gevonden && goto :installsymantecx86 if %PROCESSOR_ARCHITECTURE%==AMD64 echo x64 Windows gevonden && goto :installsymantecx64 :installsymantecx86 "%CD%\installs\symantecx86\setup.exe" if %ERRORLEVEL%==0 echo OK && goto :installsccm if %ERRORLEVEL% GEQ 1 echo FAIL && goto :installsccm goto :end :installsymantecx64 "%CD%\installs\symantecx64\setup.exe" if %ERRORLEVEL%==0 echo OK && goto :installsccm if %ERRORLEVEL% GEQ 1 echo OK, herstart vereist && goto :installsccm goto :end :installsccm echo SCCM agent installeren... "%CD%\installs\sccm\ccmsetup.exe" if %ERRORLEVEL%==0 echo OK && goto :joindomain if %ERRORLEVEL% GEQ 1 echo FAIL && goto :joindomain :joindomain echo Domein joinen... if /I %computername:~0,1% EQU W echo W gevonden, dit systeem wordt verplaatst naar de Desktops OU && goto :joindomainW if /I %computername:~0,1% EQU L echo L gevonden, dit systeem wordt verplaatst naar de Laptop OU && goto :joindomainL :joindomainW powershell ".\scripts\joindomaindesktop.ps1" if %ERRORLEVEL%==0 echo Het systeem gejoined aan het domein vnog.intra en gemoved naar de Desktops OU... && goto :copyshortcut if %ERRORLEVEL% GEQ 1 echo domein joinen is mislukt... && goto :copyshortcut goto :copyshortcut goto :deleteshortcut :joindomainL powershell ".\scripts\joindomainlaptop.ps1" if %ERRORLEVEL%==0 echo Het systeem is gejoined aan het domein vnog.intra en gemoved naar de Laptops OU... && goto :copyshortcut if %ERRORLEVEL% GEQ 1 echo domein joinen is mislukt... && goto :copyshortcut goto :copyshortcut goto :deleteshortcut :copyshortcut echo Snelkoppelingen kopieren if %OS_%==7 goto :copyshortcut7 if %OS_%==XP goto :copyshortcutxp :deleteshortcut echo Snelkoppeling verwijderen if %OS_%==7 goto :deleteshortcut7 if %OS_%==XP goto :deleteshortcutxp :installprinters if %PROCESSOR_ARCHITECTURE%==x86 echo x86 Windows gevonden && if %OS_%==XP goto :installhpuniversaldriverwinxpx86 if %PROCESSOR_ARCHITECTURE%==x86 echo x86 Windows gevonden && if %OS_%==7 goto :installhpuniversaldriverwin7x86 if %PROCESSOR_ARCHITECTURE%==AMD64 echo x64 Windows gevonden && if %OS_%==7 goto :installhpuniversaldriverwin7x64 :deleteshortcut7 del "%ALLUSERSPROFILE%\Start Menu\Programs\Startup\*.lnk" /F /Q if %ERRORLEVEL%==0 echo OK && goto :end if %ERRORLEVEL% GEQ 1 echo FAIL && goto :end goto :end :deleteshortcutxp del "%ALLUSERSPROFILE%\Start Menu\Programs\Startup\*.lnk" /F /Q if %ERRORLEVEL%==0 echo OK && goto :end if %ERRORLEVEL% GEQ 1 echo FAIL && goto :end goto :end :copyshortcut7 copy "%CD%\files\VNOG*" "%public%\Desktop" if %ERRORLEVEL%==0 echo OK && goto :end if %ERRORLEVEL% GEQ 1 echo FAIL && goto :end goto :end :copyshortcutxp copy "%CD%\files\VNOG*" "%ALLUSERSPROFILE%\Desktop" if %ERRORLEVEL%==0 echo OK && goto :end if %ERRORLEVEL% GEQ 1 echo FAIL && goto :end goto :end :installhpuniversaldriverwin7x86 echo HP Universal Print Driver - Windows 7 x86 installeren... "%CD%\installs\HPDrivers\W732bit\upd-pcl5-x32-5.5.0.12834.exe" /q /npf /sc /dso if %ERRORLEVEL%==0 echo OK && goto :end if %ERRORLEVEL% GEQ 1 echo FAIL && goto :end :installhpuniversaldriverwinxpx86 echo HP Universal Print Driver - Windows XP x86 installeren... "%CD%\installs\HPDrivers\XP32bit\upd-pcl5-x32-5.5.0.12834.exe" /q /npf /sc /dso if %ERRORLEVEL%==0 echo OK && goto :end if %ERRORLEVEL% GEQ 1 echo FAIL && goto :end :installhpuniversaldriverwin7x64 echo HP Universal Print Driver - Windows 7 x64 installeren... "%CD%\installs\HPDrivers\W764bit\upd-pcl5-x64-5.5.0.12834.exe" /q /npf /sc /dso if %ERRORLEVEL%==0 echo OK && goto :end if %ERRORLEVEL% GEQ 1 echo FAIL && goto :end :end echo Script is klaar! powershell Set-ExecutionPolicy Restricted pause echo Systeem reboot over 10 seconden... start shutdown -r -t 10 -f exit