Multi OEM/Retail Project

Discussion in 'MDL Projects and Applications' started by The_Guardian, Nov 8, 2014.

Thread Status:
Not open for further replies.
  1. The_Guardian

    The_Guardian Contributor

    May 7, 2012
    2,054
    6,803
    90
    FYI: I will not be online as much due to death in family plus I have to get surgery wed of next week.
     
  2. Mr.X

    Mr.X MDL Guru

    Jul 14, 2013
    8,575
    15,646
    270
    #2342 Mr.X, Sep 8, 2016
    Last edited: Sep 8, 2016
    My deepest condolences for your loss...
    Oh! And take care with that surgery man.
     
  3. BALTAGY

    BALTAGY MDL Guide Dog

    Dec 23, 2014
    349
    613
    10

    My prayers for you and your family and hope you do well in your surgery
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. tcntad

    tcntad MDL Guru

    Oct 26, 2009
    4,480
    1,500
    150
    Take care, MDL stays right behind you!

    And sorry for your loss, its painful
     
  5. ajripper

    ajripper MDL Novice

    Feb 7, 2015
    1
    0
    0
    #2345 ajripper, Sep 10, 2016
    Last edited: Sep 10, 2016
    install.cmd

    Can Someone tell me where is the oobe.cmd with the changes


    i have this
    @echo off


    ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    :: 'OOBE.cmd' -> 'Windows 10' • 'Windows 8.x' • 'Windows 7' • 'Windows Vista' : Sept 5|2016 ::
    ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::


    SET RQR=REG QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v "ProductName"&SET INL=IF NOT ERRORLEVEL 1


    :INSTALLS
    IF EXIST "%windir%\Setup\scripts\decompile.exe" CALL "%windir%\Setup\scripts\decompile.exe"
    IF EXIST "%windir%\Setup\scripts\decompile.exe" DEL /F /Q "%windir%\Setup\scripts\decompile.exe" >nul
    IF EXIST "%windir%\Setup\scripts\Install.cmd" CALL "%windir%\Setup\scripts\Install.cmd"
    IF EXIST "%windir%\Setup\scripts\WinTel.cmd" (ECHO %DATE% %TIME% WinTel.cmd file present and applied. >>"%SystemDrive%\Project.log") >nul
    IF EXIST "%windir%\Setup\scripts\WinTel.cmd" CALL "%windir%\Setup\scripts\WinTel.cmd"


    %RQR% | findstr /I "\<WINDOWS\>" | findstr /I "\<7\>" >nul&&%INL% GOTO :CLOSE
    %RQR% | findstr /I "\<WINDOWS\>" | findstr /I "\<VISTA\>" >nul&&%INL% GOTO :CLOSE


    ::Enables f8 key for Win 8.x and Win 10 in desktops and laptops | To disable this feature for tablets put :: in front of all 5 lines below
    bcdedit /set {default} bootmenupolicy legacy >nul
    %RQR% | findstr /I "\<WINDOWS\>" | findstr /I "\<8\>" >nul&&%INL% GOTO :CLOSE
    REG ADD "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Configuration Manager" /v "BackupCount" /D 2 /T REG_DWORD /F >nul
    REG ADD "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Configuration Manager\LastKnownGood" /v "Enabled" /D 1 /T REG_DWORD /F >nul
    TIMEOUT /T 8 >nul


    :CLOSE
    DEL /F /Q %0% >nul

    if i dont remember bad the win vista y win 7 have this

    @echo off


    :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    :: 'OOBE.cmd' -> 'Windows 10' • 'Windows 8.x' • 'Windows 7' • 'Windows Vista' : Jan 04|2015 :
    :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::


    SET EDITION=&SET CSNAME=&SET CSVENDOR=&SET SYSMODEL=&SET SYSMNF=&SET BASEPRO=&SET BASEMNF=&SET BIOVER=&SET MAN=DEFAULT&SET MAN2=&SET PIDKEY=&SET REALMAN=&SET WINVER=&SET INFO=INFO&SET LAST=LAST&SET INL=IF NOT ERRORLEVEL 1&SET RESLN=&SET SLIC=SLIC&SET DM=
    SET OEMS=%windir%\Setup\scripts\oemscan.ini&SET RQR1=REG QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v "ProductName"&SET RQR2=REG QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v "EditionId"


    :OS
    ::check • set 'Windows OS' -> '10|8.x|7|Vista' ('findstr' -> word start|end '\<','\>')
    %RQR1% | findstr /I "\<WINDOWS\>" | findstr /I "\<PREVIEW\>" >nul&&%INL% SET WINVER=10&goto :BIOS
    %RQR1% | findstr /I "\<WINDOWS\>" | findstr /I "\<10\>" >nul&&%INL% SET WINVER=10&goto :BIOS
    %RQR1% | findstr /I "\<WINDOWS\>" | findstr /I "\<8\>" >nul&&%INL% SET WINVER=8&goto :BIOS
    %RQR1% | findstr /I "\<WINDOWS\>" | findstr /I "\<7\>" >nul&&%INL% SET WINVER=7&goto :EDITION
    %RQR1% | findstr /I "\<WINDOWS\>" | findstr /I "\<VISTA\>" >nul&&%INL% SET WINVER=VISTA&goto :EDITION


    :EDITION
    ::check • set 'Windows Edition' -> 'ULTIMATE|BUSINESS|PROFESSIONAL|HOMEPREMIUM|HOMEBASIC|STARTER' ('findstr' -> word start|end '\<','\>')
    %RQR2% | findstr /I "\<ULTIMATE\>" >nul&&%INL% SET EDITION=ULTIMATE&goto :BIOS
    %RQR2% | findstr /I "\<BUSINESS\>" >nul&&%INL% SET EDITION=BUSINESS&goto :BIOS
    %RQR2% | findstr /I "\<PROFESSIONAL\>" >nul&&%INL% SET EDITION=PROFESSIONAL&goto :BIOS
    %RQR2% | findstr /I "\<HOMEPREMIUM\>" >nul&&%INL% SET EDITION=HOMEPREMIUM&goto :BIOS
    %RQR2% | findstr /I "\<HOMEBASIC\>" >nul&&%INL% SET EDITION=HOMEBASIC&goto :BIOS
    %RQR2% | findstr /I "\<STARTER\>" >nul&&%INL% SET EDITION=STARTER&goto :BIOS


    :BIOS
    ::check • set 'Manufacturer Name' from 'CSPRODUCT|COMPUTERSYSTEM|BASEBOARD|BIOS' ID's -> filter 'results' via oemscan.ini
    for /f "tokens=2 delims==" %%A in ('"WMIC CSPRODUCT GET NAME /format:list"') do %INL% (set CSNAME=%%A)
    for /f "tokens=2 delims==" %%A in ('"WMIC CSPRODUCT GET VENDOR /format:list"') do %INL% (set CSVENDOR=%%A)
    for /f "tokens=2 delims==" %%A in ('"WMIC COMPUTERSYSTEM GET MODEL /format:list"') do %INL% (set SYSMODEL=%%A)
    for /f "tokens=2 delims==" %%A in ('"WMIC COMPUTERSYSTEM GET MANUFACTURER /format:list"') do %INL% (set SYSMNF=%%A)
    for /f "tokens=2 delims==" %%A in ('"WMIC BASEBOARD GET PRODUCT /format:list"') do %INL% (set BASEPRO=%%A)
    for /f "tokens=2 delims==" %%A in ('"WMIC BASEBOARD GET MANUFACTURER /format:list"') do %INL% (set BASEMNF=%%A)
    for /f "tokens=2 delims== " %%A in ('"WMIC BIOS GET VERSION /format:list"') do %INL% (set BIOVER=%%A)


    :FILTER
    ::check • filter 'results' ('findstr' specific list order -> word start|end '\<','\>') -> by-pass 'void|conflict' entries
    SET "VOID0= "&SET VOID1=To Be Filled By O.E.M.&SET VOID2=System Product Name&SET VOID3=System manufacturer&SET VOID4=Base Board Product Name
    :CHECK1
    IF /I "%CSNAME%"=="%VOID0%" (goto :CHECK2) else IF DEFINED VOID1 IF /I "%CSNAME%"=="%VOID1%" (goto :CHECK2) else IF DEFINED VOID2 IF /I "%CSNAME%"=="%VOID2%" (goto :CHECK2) else IF DEFINED VOID3 IF /I "%CSNAME%"=="%VOID3%" (goto :CHECK2) else IF DEFINED VOID4 IF /I "%CSNAME%"=="%VOID4%" (goto :CHECK2)
    IF EXIST %OEMS% for /f "tokens=1,2,3 delims=|" %%a in ('type %OEMS% ^| findstr /I "\<%%INFO%%\>" ^| findstr /I "\<%%CSNAME%%"') do (set MAN=%%c&goto :SETKEY)
    :CHECK2
    IF /I "%SYSMODEL%"=="%VOID0%" (goto :CHECK3) else IF DEFINED VOID1 IF /I "%SYSMODEL%"=="%VOID1%" (goto :CHECK3) else IF DEFINED VOID2 IF /I "%SYSMODEL%"=="%VOID2%" (goto :CHECK3) else IF DEFINED VOID3 IF /I "%SYSMODEL%"=="%VOID3%" (goto :CHECK3) else IF DEFINED VOID4 IF /I "%SYSMODEL%"=="%VOID4%" (goto :CHECK3)
    IF EXIST %OEMS% for /f "tokens=1,2,3 delims=|" %%a in ('type %OEMS% ^| findstr /I "\<%%INFO%%\>" ^| findstr /I "\<%%SYSMODEL%%"') do (set MAN=%%c&goto :SETKEY)
    :CHECK3
    IF /I "%BASEPRO%"=="%VOID0%" (goto :CHECK4) else IF DEFINED VOID1 IF /I "%BASEPRO%"=="%VOID1%" (goto :CHECK4) else IF DEFINED VOID2 IF /I "%BASEPRO%"=="%VOID2%" (goto :CHECK4) else IF DEFINED VOID3 IF /I "%BASEPRO%"=="%VOID3%" (goto :CHECK4) else IF DEFINED VOID4 IF /I "%BASEPRO%"=="%VOID4%" (goto :CHECK4)
    IF EXIST %OEMS% for /f "tokens=1,2,3 delims=|" %%a in ('type %OEMS% ^| findstr /I "\<%%INFO%%\>" ^| findstr /I "\<%%BASEPRO%%"') do (set MAN=%%c&goto :SETKEY)
    :CHECK4
    IF /I "%CSVENDOR%"=="%VOID0%" (goto :CHECK5) else IF DEFINED VOID1 IF /I "%CSVENDOR%"=="%VOID1%" (goto :CHECK5) else IF DEFINED VOID2 IF /I "%CSVENDOR%"=="%VOID2%" (goto :CHECK5) else IF DEFINED VOID3 IF /I "%CSVENDOR%"=="%VOID3%" (goto :CHECK5) else IF DEFINED VOID4 IF /I "%CSVENDOR%"=="%VOID4%" (goto :CHECK5)
    IF EXIST %OEMS% for /f "tokens=1,2,3 delims=|" %%a in ('type %OEMS% ^| findstr /I "\<%%INFO%%\>" ^| findstr /I "\<%%CSVENDOR%%"') do (set MAN=%%c&goto :SETKEY)
    :CHECK5
    IF /I "%SYSMNF%"=="%VOID0%" (goto :CHECK6) else IF DEFINED VOID1 IF /I "%SYSMNF%"=="%VOID1%" (goto :CHECK6) else IF DEFINED VOID2 IF /I "%SYSMNF%"=="%VOID2%" (goto :CHECK6) else IF DEFINED VOID3 IF /I "%SYSMNF%"=="%VOID3%" (goto :CHECK6) else IF DEFINED VOID4 IF /I "%SYSMNF%"=="%VOID4%" (goto :CHECK6)
    IF EXIST %OEMS% for /f "tokens=1,2,3 delims=|" %%a in ('type %OEMS% ^| findstr /I "\<%%INFO%%\>" ^| findstr /I "\<%%SYSMNF%%"') do (set MAN=%%c&goto :SETKEY)
    :CHECK6
    REG QUERY "HKLM\SYSTEM\ControlSet001\Control\SystemInformation" /v "SystemManufacturer" | findstr /I "\<VMware\>" >nul&&%INL% goto :SETKEY
    REG QUERY "HKLM\SYSTEM\ControlSet001\Control\SystemInformation" /v "SystemProductName" | findstr /I "\<VirtualBox\>" >nul&&%INL% goto :SETKEY
    IF /I "%BASEMNF%"=="%VOID0%" (goto :CHECKOUT) else IF DEFINED VOID1 IF /I "%BASEMNF%"=="%VOID1%" (goto :CHECKOUT) else IF DEFINED VOID2 IF /I "%BASEMNF%"=="%VOID2%" (goto :CHECKOUT) else IF DEFINED VOID3 IF /I "%BASEMNF%"=="%VOID3%" (goto :CHECKOUT) else IF DEFINED VOID4 IF /I "%BASEMNF%"=="%VOID4%" (goto :CHECKOUT)
    IF EXIST %OEMS% for /f "tokens=1,2,3 delims=|" %%a in ('type %OEMS% ^| findstr /I "\<%%INFO%%\>" ^| findstr /I "\<%%BASEMNF%%"') do (set MAN=%%c&goto :SETKEY)
    :CHECKOUT
    IF EXIST %OEMS% for /f "tokens=1,2,3 delims=|" %%a in ('type %OEMS% ^| findstr /I "\<%%SLIC%%\>" ^| findstr /I "\<%%BIOVER%%\>"') do (set MAN=%%c&goto :SETKEY)


    :SETKEY
    ::set 'genuine' activation -> use bios version id (if detected), bios may be modded|shared (ie.'Dell PC' - bios mod 'ACRSYS-Acer'; etc) -> ('findstr' -> word start|end '\<','\>')
    IF EXIST %OEMS% for /f "tokens=1,2,3 delims=|" %%a in ('type %OEMS% ^| findstr /I "\<%%SLIC%%\>" ^| findstr /I "\<%%BIOVER%%\>"') do (set MAN2=%%c)
    IF /I "%MAN%"=="DEFAULT" REG QUERY "HKLM\SYSTEM\ControlSet001\Control\SystemInformation" /v "SystemManufacturer" | findstr /I "\<VMware\>" >nul&&%INL% SET MAN=VMWARE
    IF /I "%MAN%"=="DEFAULT" REG QUERY "HKLM\SYSTEM\ControlSet001\Control\SystemInformation" /v "SystemProductName" | findstr /I "\<VirtualBox\>" >nul&&%INL% SET MAN=VBOX
    IF /I "%MAN2%"=="GATEWAY" IF /I "%MAN%"=="EMACHINES" SET MAN2=EMACHINES&goto :SERIAL
    IF /I "%MAN2%"=="ACER" IF /I "%MAN%"=="EMACHINES" SET MAN2=EMACHINES&goto :SERIAL
    IF /I "%MAN2%"=="ACER" IF /I "%MAN%"=="GATEWAY" SET MAN2=GATEWAY&goto :SERIAL
    IF /I "%MAN2%"=="ACER" IF /I "%MAN%"=="PBELL" SET MAN2=PBELL&goto :SERIAL
    IF /I "%MAN2%"=="HP" IF /I "%MAN%"=="COMPAQ" SET MAN2=COMPAQ&goto :SERIAL
    IF /I "%MAN2%"=="LENOVO" IF /I "%MAN%"=="IBM" SET MAN2=IBM&goto :SERIAL
    IF NOT DEFINED MAN2 SET MAN2=%MAN%&goto :SERIAL


    :SERIAL
    ::scan 'oemscan.ini' once with the provided 'Manufacturer|OS|Edition' -> if not matched, set the manufacturer (serial) to 'DEFAULTOEM' (Acer) & try again -> ('findstr' -> word start|end '\<','\>')
    IF /I "%WINVER%"=="10" GOTO :WIN810
    IF /I "%WINVER%"=="8" GOTO :WIN810
    IF NOT DEFINED WINVER GOTO :BRANDING
    IF NOT DEFINED EDITION GOTO :BRANDING
    IF EXIST %OEMS% for /f "tokens=1,2,3,4 delims=|" %%a in ('type %OEMS% ^| findstr /I "\<%%EDITION%%\>" ^| findstr /I "\<%%MAN2%%\>"') do (echo %%a | findstr /I "\<%WINVER%\>" >nul &&%INL% set PIDKEY=%%d)
    IF NOT DEFINED PIDKEY set REALMAN=%MAN2%&set MAN2=DEFAULTOEM&goto :SERIAL
    IF /I "%MAN2%"=="DEFAULTOEM" set MAN2=%REALMAN%


    :ACTIVATION
    ::create 'OEM Certificates' for 'VISTA|WIN7'
    IF EXIST %OEMS% for /f "tokens=1,2,3 delims=|" %%a in ('type %OEMS% ^| findstr /I "CERT" ^| findstr /I "\<%%MAN2%%\>"') do (set CERTID=%%c)
    IF DEFINED CERTID IF NOT EXIST "%windir%\Setup\scripts\Certificates" MD "%windir%\Setup\scripts\Certificates" >nul
    IF DEFINED CERTID ECHO.%CERTID%>"%windir%\Setup\scripts\Certificates\%MAN2%.XRM-MS"
    IF EXIST %OEMS% for /f "tokens=1,2,3 delims=|" %%a in ('type %OEMS% ^| findstr /I "CERT" ^| findstr /I "\<%%MAN2%%2\>"') do (set CERTID2=%%c)
    IF DEFINED CERTID2 ECHO.%CERTID2%>"%windir%\Setup\scripts\Certificates\%MAN2%2.XRM-MS"
    IF EXIST %OEMS% for /f "tokens=1,2,3 delims=|" %%a in ('type %OEMS% ^| findstr /I "CERT" ^| findstr /I "\<%%MAN2%%3\>"') do (set CERTID3=%%c)
    IF DEFINED CERTID3 ECHO.%CERTID3%>"%windir%\Setup\scripts\Certificates\%MAN2%3.XRM-MS"
    IF EXIST %OEMS% for /f "tokens=1,2,3 delims=|" %%a in ('type %OEMS% ^| findstr /I "CERT" ^| findstr /I "\<%%MAN2%%4\>"') do (set CERTID4=%%c)
    IF DEFINED CERTID4 ECHO.%CERTID4%>"%windir%\Setup\scripts\Certificates\%MAN2%4.XRM-MS"
    IF EXIST %OEMS% for /f "tokens=1,2,3 delims=|" %%a in ('type %OEMS% ^| findstr /I "CERT" ^| findstr /I "\<%%MAN2%%5\>"') do (set CERTID5=%%c)
    IF DEFINED CERTID5 ECHO.%CERTID5%>"%windir%\Setup\scripts\Certificates\%MAN2%5.XRM-MS"
    IF EXIST %OEMS% for /f "tokens=1,2,3 delims=|" %%a in ('type %OEMS% ^| findstr /I "CERT" ^| findstr /I "\<%%MAN2%%6\>"') do (set CERTID6=%%c)
    IF DEFINED CERTID6 ECHO.%CERTID6%>"%windir%\Setup\scripts\Certificates\%MAN2%6.XRM-MS"
    IF EXIST %OEMS% for /f "tokens=1,2,3 delims=|" %%a in ('type %OEMS% ^| findstr /I "CERT" ^| findstr /I "\<%%MAN2%%7\>"') do (set CERTID7=%%c)
    IF DEFINED CERTID7 ECHO.%CERTID7%>"%windir%\Setup\scripts\Certificates\%MAN2%7.XRM-MS"
    IF EXIST %OEMS% for /f "tokens=1,2,3 delims=|" %%a in ('type %OEMS% ^| findstr /I "CERT" ^| findstr /I "\<%%MAN2%%8\>"') do (set CERTID8=%%c)
    IF DEFINED CERTID8 ECHO.%CERTID8%>"%windir%\Setup\scripts\Certificates\%MAN2%8.XRM-MS"
    IF EXIST %OEMS% for /f "tokens=1,2,3 delims=|" %%a in ('type %OEMS% ^| findstr /I "CERT" ^| findstr /I "\<%%MAN2%%9\>"') do (set CERTID9=%%c)
    IF DEFINED CERTID9 ECHO.%CERTID9%>"%windir%\Setup\scripts\Certificates\%MAN2%9.XRM-MS"
    IF EXIST %OEMS% for /f "tokens=1,2,3 delims=|" %%a in ('type %OEMS% ^| findstr /I "CERT" ^| findstr /I "\<%%MAN2%%10\>"') do (set CERTID10=%%c)
    IF DEFINED CERTID10 ECHO.%CERTID10%>"%windir%\Setup\scripts\Certificates\%MAN2%10.XRM-MS"
    IF EXIST %OEMS% for /f "tokens=1,2,3 delims=|" %%a in ('type %OEMS% ^| findstr /I "CERT" ^| findstr /I "\<%%MAN2%%11\>"') do (set CERTID11=%%c)
    IF DEFINED CERTID11 ECHO.%CERTID11%>"%windir%\Setup\scripts\Certificates\%MAN2%11.XRM-MS"
    IF EXIST %OEMS% for /f "tokens=1,2,3 delims=|" %%a in ('type %OEMS% ^| findstr /I "CERT" ^| findstr /I "\<%%MAN2%%12\>"') do (set CERTID12=%%c)
    IF DEFINED CERTID12 ECHO.%CERTID12%>"%windir%\Setup\scripts\Certificates\%MAN2%12.XRM-MS"


    ::create 'activate.cmd' -> 'CALL' -> from 'OOBE.cmd' for 'WIN7' or 'SetupComplete.cmd' for 'VISTA'
    (echo @echo off & echo. & echo :ACTIVATE & echo ::apply serial:: & echo cscript //nologo %windir%\system32\slmgr.vbs -ipk %PIDKEY% ^>^nul & echo ::apply certificate ^& 2nd, 3rd, 4th, etc, if available::
    echo IF EXIST "%windir%\Setup\scripts\Certificates\%MAN2%.XRM-MS" for /f "tokens=*" %%%%A in ^('DIR /B "%windir%\Setup\scripts\Certificates\%MAN2%*.XRM-MS"'^) DO ^(
    echo cscript //nologo %windir%\system32\slmgr.vbs -ilc "%windir%\Setup\scripts\Certificates\%%%%A" ^>^nul^) & echo IF EXIST "%windir%\Setup\scripts\oemscan.ini" DEL /F /Q "%windir%\Setup\scripts\oemscan.ini" ^>^nul
    echo IF EXIST "%windir%\Setup\scripts\Certificates" DEL /S /F /Q "%windir%\Setup\scripts\Certificates\*.*" ^>^nul ^&^& RD /S /Q "%windir%\Setup\scripts\Certificates" ^>^nul) >"%windir%\Setup\scripts\activate.cmd"
    IF /I NOT "%WINVER%"=="VISTA" GOTO :OOBE


    ::'VISTA only' check 'SetupComplete.cmd' exists -> 'NO' rename|edit 'activate.cmd' -> 'YES' -> edit existing 'SetupComplete.cmd'
    IF NOT EXIST %windir%\Setup\scripts\SetupComplete.cmd (move /Y %windir%\Setup\scripts\activate.cmd %windir%\Setup\scripts\no4.txt >nul
    (echo RD /S /Q "%windir%\Setup\scripts" ^>^nul & echo DEL /F /Q %%0%% ^>^nul) >%windir%\Setup\scripts\no3.txt
    copy /b %windir%\Setup\scripts\no4.txt+%windir%\Setup\scripts\no3.txt %windir%\Setup\scripts\SetupComplete.cmd >nul & del /F /Q %windir%\Setup\scripts\no4.txt >nul %windir%\Setup\scripts\no3.txt >nul
    ) ELSE (Type %windir%\Setup\scripts\SetupComplete.cmd | findstr /I /V /C:"@echo off" >%windir%\Setup\scripts\no2.txt && del /F /Q %windir%\Setup\scripts\SetupComplete.cmd >nul
    (echo @echo off & echo. & echo IF EXIST %windir%\Setup\scripts\activate.cmd CALL %windir%\Setup\scripts\activate.cmd ^>^nul ^&^& DEL /F /Q %windir%\Setup\scripts\activate.cmd ^>^nul) >%windir%\Setup\scripts\no1.txt
    copy /b %windir%\Setup\scripts\no1.txt+%windir%\Setup\scripts\no2.txt %windir%\Setup\scripts\SetupComplete.cmd >nul & del /F /Q %windir%\Setup\scripts\no1.txt >nul %windir%\Setup\scripts\no2.txt >nul)
    GOTO :BRANDING


    :WIN810
    %windir%\Setup\scripts\Rw.exe /STDOUT /NoLogo /command="ACPI Dump MSDM;RwExit" >".\msdm.log"
    for /f "Skip=1 tokens=2 delims= " %%A in ('find "-" %windir%\Setup\scripts\msdm.log') do (set DM=%%A)
    IF NOT DEFINED DM GOTO :MSDMLOG
    cscript //B %windir%\system32\slmgr.vbs /ipk %DM% >nul
    cscript //B %windir%\system32\slmgr.vbs /ato >nul
    :MSDMLOG
    IF EXIST "%windir%\Setup\scripts\Rw.exe" reg delete "HKCU\Software\Rw.exe" /f >nul
    IF EXIST "%windir%\Setup\scripts\Rw.exe" reg delete "HKCU\Software\RW-Everything" /f >nul
    IF EXIST "%windir%\Setup\scripts\Rw.exe" DEL /F /Q "%windir%\Setup\scripts\Rw.exe" >nul
    IF EXIST "%windir%\Setup\scripts\msdm.log" DEL /F /Q "%windir%\Setup\scripts\msdm.log" >nul
    GOTO :BRANDING


    :OOBE
    ::check • apply created 'activate.cmd' -> from this 'OOBE.cmd'
    IF EXIST %windir%\Setup\scripts\activate.cmd cd /d %windir%\Setup\scripts\ && CALL "activate.cmd" >nul
    IF EXIST %windir%\Setup\scripts\activate.cmd DEL /F /Q %windir%\Setup\scripts\activate.cmd >nul


    :BRANDING
    ::check • set 'MAN=?' -> if exist 'Force_Theme_[readme].txt' || edit brand '.reg file' -> if installing 'Starter' Edition
    cd /d %windir%\Setup\scripts\OEM's\ && for /r %%G in (.) DO IF EXIST %%G\Force_Theme_[readme].txt DEL /F /Q %%G\Force_Theme_[readme].txt >nul &&set MAN=%%~nG
    IF EXIST "%windir%\Setup\scripts\Force_Theme_[readme].txt" DEL /F /Q "%windir%\Setup\scripts\Force_Theme_[readme].txt" >nul
    IF /I NOT "%EDITION%"=="STARTER" GOTO :CONTINUE
    IF EXIST "%windir%\Setup\scripts\OEM's\%MAN%\%MAN%.reg" (cd /d %windir%\Setup\scripts\OEM's\%MAN%\ >nul & Type %MAN%.reg | findstr /I /V "InstallTheme" >STARTER.reg && MOVE /Y "STARTER.reg" "%MAN%.reg" >nul)


    :CONTINUE
    ::finalize branding|theme
    IF NOT EXIST "%windir%\Setup\scripts\OEM's\%MAN%\%MAN%.reg" goto :TRANSFERS
    start /w regedit /s "%windir%\Setup\scripts\OEM's\%MAN%\%MAN%.reg" && DEL /F /Q "%windir%\Setup\scripts\OEM's\%MAN%\%MAN%.reg" >nul
    for /f "tokens=2* delims= " %%A IN ('REG QUERY "HKLM\HARDWARE\DESCRIPTION\System\BIOS" /v SystemProductName') DO %INL% set SYSPDT=%%B
    IF NOT DEFINED SYSPDT (goto :TRANSFERS) else IF DEFINED VOID1 IF /I "%SYSPDT%"=="%VOID1%" (goto :TRANSFERS) else IF DEFINED VOID2 IF /I "%SYSPDT%"=="%VOID2%" (goto :TRANSFERS) else IF DEFINED VOID3 IF /I "%SYSPDT%"=="%VOID3%" (goto :TRANSFERS) else IF DEFINED VOID4 IF /I "%SYSPDT%"=="%VOID4%" (goto :TRANSFERS) else IF DEFINED VOID5 IF /I "%SYSPDT%"=="%VOID5%" (goto :TRANSFERS)
    reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation" /f /v "Model" /t REG_SZ /d "%SYSPDT%" >nul


    :TRANSFERS
    ::check • screen resolution -> movements|actions
    %windir%\Setup\scripts\MultiMonitorTool.exe /HideInactiveMonitors 1 /stext %windir%\Setup\scripts\monitor.txt
    for /f "tokens=2,3 delims=,: " %%i in ('type %windir%\Setup\scripts\monitor.txt ^| find /i "Right-Bottom"') do (set RESLN=%%iX%%j)
    IF EXIST "%windir%\Setup\scripts\MultiMonitorTool.exe" DEL /F /Q "%windir%\Setup\scripts\MultiMonitorTool.exe" >nul
    IF EXIST "%windir%\Setup\scripts\monitor.txt" DEL /F /Q "%windir%\Setup\scripts\monitor.txt" >nul
    IF EXIST "%windir%\Setup\scripts\OEM's\%MAN%\%RESLN%.jpg" DEL /F /Q "%windir%\Setup\scripts\OEM's\%MAN%\WALLPAPER.jpg" >nul && MOVE /Y "%windir%\Setup\scripts\OEM's\%MAN%\%RESLN%.jpg" "%windir%\Setup\scripts\OEM's\%MAN%\WALLPAPER.jpg" >nul
    IF EXIST "%windir%\Setup\scripts\OEM's\%MAN%\Backgrounds\%RESLN%.jpg" DEL /F /Q "%windir%\Setup\scripts\OEM's\%MAN%\Backgrounds\BACKGROUNDDEFAULT.jpg" >nul && MOVE /Y "%windir%\Setup\scripts\OEM's\%MAN%\Backgrounds\%RESLN%.jpg" "%windir%\Setup\scripts\OEM's\%MAN%\Backgrounds\BACKGROUNDDEFAULT.jpg" >nul
    IF EXIST "%windir%\Setup\scripts\OEM's\%MAN%\Backgrounds\BACKGROUNDDEFAULT.jpg" REN "%windir%\Setup\scripts\OEM's\%MAN%\Backgrounds\BACKGROUNDDEFAULT.jpg" "BACKGROUNDDEFAULT.bak" >nul && DEL /F /Q "%windir%\Setup\scripts\OEM's\%MAN%\Backgrounds\*.jpg" >nul & REN "%windir%\Setup\scripts\OEM's\%MAN%\Backgrounds\BACKGROUNDDEFAULT.bak" "BACKGROUNDDEFAULT.jpg" >nul
    IF EXIST "%windir%\Setup\scripts\OEM's\%MAN%\WALLPAPER.jpg" REN "%windir%\Setup\scripts\OEM's\%MAN%\WALLPAPER.jpg" "WALLPAPER.bak" >nul && DEL /F /Q "%windir%\Setup\scripts\OEM's\%MAN%\*.jpg" >nul & REN "%windir%\Setup\scripts\OEM's\%MAN%\WALLPAPER.bak" "WALLPAPER.jpg" >nul
    :TRANSFER1
    ::check • 'Vista' -> movements|actions
    IF /I NOT "%WINVER%"=="VISTA" goto :TRANSFER2
    IF EXIST "%windir%\Setup\scripts\OEM's\%MAN%\backgrounds" cd /d %windir%\Setup\scripts\OEM's\%MAN%\ && RD /S /Q "backgrounds" >nul
    IF EXIST "%windir%\Setup\scripts\OEM's\%MAN%\WALLPAPER.jpg" REN %windir%\Web\Wallpaper\img24.jpg img24.bak && COPY /Y "%windir%\Setup\scripts\OEM's\%MAN%\WALLPAPER.jpg" "%windir%\Web\Wallpaper\img24.jpg" >nul
    :TRANSFER2
    ::check • 'Win8.x and Win 10' -> movements|actions
    IF /I "%WINVER%"=="VISTA" GOTO :TRANSFER3
    IF /I "%WINVER%"=="7" GOTO :TRANSFER3
    IF EXIST "%windir%\Setup\scripts\OEM's\%MAN%\USER.bmp" MD "%systemdrive%\$%MAN%$\Account" >nul && MOVE /Y "%windir%\Setup\scripts\OEM's\%MAN%\USER.bmp" "%systemdrive%\$%MAN%$\Account\user.bmp" >nul
    IF EXIST "%systemdrive%\$%MAN%$\Account\user.bmp" REN "%ProgramData%\Microsoft\User Account Pictures\user.bmp" "user.bmp.bak" >nul && COPY /Y "%systemdrive%\$%MAN%$\Account\user.bmp" "%ProgramData%\Microsoft\User Account Pictures\user.bmp" >nul && COPY /Y "%ProgramData%\Microsoft\User Account Pictures\user.bmp.bak" "%systemdrive%\$%MAN%$\Account\original.bmp" >nul
    IF EXIST "%systemdrive%\$%MAN%$\Account\user.bmp" REN "%ProgramData%\Microsoft\User Account Pictures\user.png" "user.png.bak" >nul && COPY /Y "%systemdrive%\$%MAN%$\Account\user.bmp" "%ProgramData%\Microsoft\User Account Pictures\user.png" >nul
    IF EXIST "%systemdrive%\$%MAN%$\Account\user.bmp" REN "%ProgramData%\Microsoft\User Account Pictures\user-40.png" "user-40.png.bak" >nul && COPY /Y "%systemdrive%\$%MAN%$\Account\user.bmp" "%ProgramData%\Microsoft\User Account Pictures\user-40.png" >nul
    IF EXIST "%systemdrive%\$%MAN%$\Account\user.bmp" REN "%ProgramData%\Microsoft\User Account Pictures\user-200.png" "user-200.png.bak" >nul && COPY /Y "%systemdrive%\$%MAN%$\Account\user.bmp" "%ProgramData%\Microsoft\User Account Pictures\user-200.png" >nul
    IF EXIST "%windir%\Setup\scripts\OEM's\%MAN%\OOBE.xml" DEL /F /Q "%windir%\Setup\scripts\OEM's\%MAN%\OOBE.xml" >nul
    IF EXIST "%windir%\Setup\scripts\OEM's\%MAN%\*.theme" TAKEOWN /F "%windir%\Resources\Themes\*.theme" >nul & ICACLS "%windir%\Resources\Themes\*.theme" /reset /T /Q >nul & ICACLS "%windir%\Resources\Themes\*.theme" /grant:r "%windir%\Resources\Themes\*.theme:(OI)(CI)F" 2>nul & REN "%windir%\Resources\Themes\aero.theme" theme3.theme >nul & MOVE /Y "%windir%\Setup\scripts\OEM's\%MAN%\*.theme" "%windir%\Resources\Themes\aero.theme" >nul
    IF EXIST "%windir%\Web\Screen\img100.jpg" TAKEOWN /F "%windir%\Web\Screen\*.jpg" >nul & ICACLS "%windir%\Web\Screen\*.jpg" /reset /T /Q >nul & IF EXIST "%windir%\Setup\scripts\OEM's\%MAN%\Backgrounds\BACKGROUNDDEFAULT.jpg" MD "%systemdrive%\$%MAN%$\LockScreen" >nul && MOVE /Y "%windir%\Web\Screen\img100.jpg" "%systemdrive%\$%MAN%$\LockScreen\original.jpg" >nul && COPY /Y "%windir%\Setup\scripts\OEM's\%MAN%\Backgrounds\BACKGROUNDDEFAULT.jpg" "%systemdrive%\$%MAN%$\LockScreen\LockScreen.jpg" >nul && COPY /Y "%windir%\Setup\scripts\OEM's\%MAN%\Backgrounds\BACKGROUNDDEFAULT.jpg" "%windir%\Web\Screen\img100.jpg" >nul
    IF EXIST "%windir%\Web\Screen\img100.png" TAKEOWN /F "%windir%\Web\Screen\*.png" >nul & ICACLS "%windir%\Web\Screen\*.png" /reset /T /Q >nul & IF EXIST "%windir%\Setup\scripts\OEM's\%MAN%\Backgrounds\BACKGROUNDDEFAULT.jpg" MD "%systemdrive%\$%MAN%$\LockScreen" >nul && MOVE /Y "%windir%\Web\Screen\img100.png" "%systemdrive%\$%MAN%$\LockScreen\original.png" >nul && COPY /Y "%windir%\Setup\scripts\OEM's\%MAN%\Backgrounds\BACKGROUNDDEFAULT.jpg" "%systemdrive%\$%MAN%$\LockScreen\LockScreen.jpg" >nul && COPY /Y "%windir%\Setup\scripts\OEM's\%MAN%\Backgrounds\BACKGROUNDDEFAULT.jpg" "%windir%\Web\Screen\img100.png" >nul
    IF EXIST "%windir%\Setup\scripts\OEM's\%MAN%\WALLPAPER.jpg" MD "%systemdrive%\$%MAN%$\Desktop" >nul && COPY /Y "%windir%\Setup\scripts\OEM's\%MAN%\WALLPAPER.jpg" "%systemdrive%\$%MAN%$\Desktop\Desktop.jpg" >nul
    IF EXIST "%systemdrive%\$%MAN%$" MOVE /Y "%systemdrive%\$%MAN%$" "%windir%\$%MAN%$" >nul


    ::Enables f8 key for Win 8.x and Win 10 in desktops and laptops | To disable this feature for tablets put :: in front of the line below
    bcdedit /set {default} bootmenupolicy legacy >nul


    :TRANSFER3
    ::check • 'Windows OS' -> movements|actions
    IF EXIST "%windir%\Setup\scripts\OEM's\%MAN%\USER.bmp" MOVE /Y "%windir%\Setup\scripts\OEM's\%MAN%\USER.bmp" "%ProgramData%\Microsoft\User Account Pictures\user.bmp" >nul
    IF EXIST "%windir%\Setup\scripts\OEM's\%MAN%\*.theme" MOVE /Y "%windir%\Setup\scripts\OEM's\%MAN%\*.theme" "%windir%\Resources\Themes\$OEM$.theme" >nul
    IF EXIST "%windir%\Setup\scripts\OEM's\%MAN%\*.*" MD "%windir%\system32\oobe\info" 2>nul & for /f "delims==" %%F IN ('dir "%windir%\Setup\scripts\OEM's\%MAN%\*.*" /s /b') DO MOVE /Y "%%F" "%windir%\system32\oobe\info" 2>nul
    cd /d %windir%\Setup\scripts\
    IF EXIST "%windir%\Setup\scripts\OEM's" DEL /S /F /Q "%windir%\Setup\scripts\OEM's\*.*" >nul && RD /S /Q "%windir%\Setup\scripts\OEM's" >nul
    IF /I "%WINVER%"=="VISTA" GOTO :CLOSE
    IF EXIST "%windir%\Setup\scripts\oemscan.ini" DEL /F /Q "%windir%\Setup\scripts\oemscan.ini" >nul


    :CLOSE
    ::finished -> remove 'scripts' dir ('RunOnce' Reg entry) -> self delete 'OOBE.cmd'
    (echo @echo off & echo. & echo IF EXIST "%windir%\Setup\scripts" RD /S /Q "%windir%\Setup\scripts" ^>^nul & echo DEL /F /Q %%0%% ^>^nul) >"%windir%\Cleanup.cmd"
    reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" /v !Clean /t REG_SZ /d "%windir%\Cleanup.cmd" /f >nul
    Timeout /T 8 >nul
    DEL /F /Q %0% >nul
     
  6. The_Guardian

    The_Guardian Contributor

    May 7, 2012
    2,054
    6,803
    90
    #2346 The_Guardian, Sep 10, 2016
    Last edited: Sep 10, 2016
    (OP)
    Would have been nice to use a spoiler. There is no need for anyone to edit the script anymore to avoid issues. Plus it has all been compressed to save space.

    Note: Working on fix for win10 anniversary build login background not applying. Requires logoff in order for setting to hold.

    Update: Almost done testing.

    Mr.X is buying the beers today. :D
     
  7. BALTAGY

    BALTAGY MDL Guide Dog

    Dec 23, 2014
    349
    613
    10
    I have a new Lenovo Laptop ready to test :clap:
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. The_Guardian

    The_Guardian Contributor

    May 7, 2012
    2,054
    6,803
    90
    #2348 The_Guardian, Sep 10, 2016
    Last edited: Sep 11, 2016
    (OP)
    Ok, after much testing I found out that the win10 login background image is in user profile of registry, not the system. If end user wishes to add image it is saved under that specific user, not the system. In other words if no password and you are starting the machine, you will see system blue background. Once at desktop user can sign off and then see oem login background image. Its tied to the user to change the user profile image but system will always show default on restart or startup. M$ is forcing the blue background in win10, like win8.x but in win10 the user profile can be changed to show any pic but only once signed in and they sign off. Win10 system default login background is blue but user profile can be changed. Guess it is somewhat an improvement over win8.x but still fully enabled customization of login background. It is what it is. Soon we nor oem's wont be able to customize anymore.

    Update: Going to see if win8.x "user profile" login background can be changed as well. I am curious... That's a no go. So I made sure the reg entry isnt applied for win8.x where in earlier release it was, by mistake. Didnt hurt anything but still. I corrected logoff not running.
     
  9. BALTAGY

    BALTAGY MDL Guide Dog

    Dec 23, 2014
    349
    613
    10

    I tried to logoff and login after i finished installing just to test and login background not removed yet after installing drivers and installing software now with many restarts

    I will try to logoff and login with every laptop to test if it will stick or not
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  10. The_Guardian

    The_Guardian Contributor

    May 7, 2012
    2,054
    6,803
    90
    #2350 The_Guardian, Sep 11, 2016
    Last edited: Sep 11, 2016
    (OP)
    If you go to sign off then it will show. If you do two normal restarts without signing off then it will revert back to blue system background. Anytime you sign off it will be there, now for sure because there was a bug in it that I noticed. Corrected now though. It's tied to the user not the system but in win8.x we didnt have that choice so I guess this is an improvement. lol I am doing final testing now to make sure everything is working. Once completed I will upload for everyone.
     
  11. The_Guardian

    The_Guardian Contributor

    May 7, 2012
    2,054
    6,803
    90
    First post updated 9-9-2016. See change log for details. Also included notes about win8.x and win10 "user" login background image on first post.
     
  12. Mr.X

    Mr.X MDL Guru

    Jul 14, 2013
    8,575
    15,646
    270
    OCD at its best! L0L just kidding! :biggrin:
     
  13. The_Guardian

    The_Guardian Contributor

    May 7, 2012
    2,054
    6,803
    90
    #2353 The_Guardian, Sep 11, 2016
    Last edited: Sep 11, 2016
    (OP)
    Edited: didnt work with kms.
     
  14. The_Guardian

    The_Guardian Contributor

    May 7, 2012
    2,054
    6,803
    90
    #2354 The_Guardian, Sep 11, 2016
    Last edited: Sep 11, 2016
    (OP)
    Seems to be specific for kms solutions here at mdl. Something isnt right and M$ is picking up on it. I did two restarts and it showed blue screen again but on third restart it showed oem image. Seems its checking online or something and kicking it out if kms isnt correct. Think the kms devs will have their hands full on this one. All we can do is wait for them to update them. Even though it says activated, something is different with win10 anniversary versions. Without kms I did 5 restarts and it holds. This tells me something to do with kms.

    Update: If using kms solutions here at mdl with this project the login image background will get kicked out after second restart. This has something to do with kms and M$ seeing it or somthing isnt right with kms. I have tested without any activation method and the login background image stays put no matter how many restarts so I do not have to update the project again. We are good. :)
     
  15. The_Guardian

    The_Guardian Contributor

    May 7, 2012
    2,054
    6,803
    90
    Surgery went well. Thanks to those that gave me support. :hug2:
     
  16. cengizhan

    cengizhan MDL Senior Member

    Jul 29, 2009
    477
    154
    10
    :hug2::thumbsup:
     
  17. Mr.X

    Mr.X MDL Guru

    Jul 14, 2013
    8,575
    15,646
    270
    #2357 Mr.X, Sep 14, 2016
    Last edited by a moderator: Apr 20, 2017
  18. wreid23

    wreid23 MDL Novice

    Oct 10, 2014
    1
    1
    0
    Thanks alot great project
     
  19. tcntad

    tcntad MDL Guru

    Oct 26, 2009
    4,480
    1,500
    150
    Been using this project for years, first start with searchengine but a question I came up with today..

    How can I use this with Windows Server and deployment?
    Im having a Server 2012 R2 set up as my deployment server with Windows 10 and W7 images but Id like to run this as well..
     
  20. The_Guardian

    The_Guardian Contributor

    May 7, 2012
    2,054
    6,803
    90
    Server editions are not supported for many reasons. Even searchengines old project did not include server editions because of the pita to employ it.