SetupComplete.cmd

Discussion in 'Scripting' started by ege914, Nov 11, 2016.

  1. ege914

    ege914 MDL Member

    Jun 29, 2015
    195
    38
    10
    hi people. i succesfully created an iso file for me

    which has some tweaks and integrated updates prepared by NTLite...

    my question is. how can i add setupcomplete. cmd yto my install.wim or install.esd? bcecause i couldnt via ntlite
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. GOD666

    GOD666 MDL Expert

    Aug 1, 2015
    1,972
    2,025
    60
    Add it to post install ;)

    Notice the little menu, below the add button, select it and you can add commands ;)
     
  3. Enthousiast

    Enthousiast MDL Tester

    Oct 30, 2009
    17,949
    23,046
    340
    Put the cmd in a folder named "Scripts" and mount install.wim and insert it in "x:\mount\windows\setup".
     
  4. ege914

    ege914 MDL Member

    Jun 29, 2015
    195
    38
    10
    --- when i add it to post install it kinda stucks at the end of windows installation at last stage...

    and

    ----i don't know how to instert/mount it to there.... i cant open or edit install.wim or *.esd...

    ++ but i put it inside sources folder
    \sources\$oem$\$$\Setup\Scripts

    ntlite added it to post install.. gonna try it i hope it works.. if it doesnt i will come back :/
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. GOD666

    GOD666 MDL Expert

    Aug 1, 2015
    1,972
    2,025
    60
    #5 GOD666, Nov 11, 2016
    Last edited by a moderator: Apr 20, 2017
    Wait... What...

    I had to rethink this....


    SetupComplete.cmd is automatically made once you finalize. You'll find it at

    Code:
    /sources/$OEM$/$$/Scripts
    If you need to customize something, you can tweak it there too ;)

    For example, mine looks like this (Do not use this unless you have the same software as me)

    Code:
    @echo off
    powercfg -h off
    net accounts /maxpwage:unlimited
    "%WINDIR%\Setup\Files\vcredist_2005_SP1_SU_x86.exe" /q
    "%WINDIR%\Setup\Files\vcredist_2005_SP1_SU_x64.exe" /q
    "%WINDIR%\Setup\Files\vcredist_2008_SU_SP1_x86.exe" /q
    "%WINDIR%\Setup\Files\vcredist_2008_SU_SP1_x64.exe" /q
    "%WINDIR%\Setup\Files\vcredist_2010_SP1_SU_x86.exe" /passive
    "%WINDIR%\Setup\Files\vcredist_2010_SP1_SU_x64.exe" /passive
    "%WINDIR%\Setup\Files\vcredist_2012_x86.exe" /passive
    "%WINDIR%\Setup\Files\vcredist_2012_x64.exe" /passive
    "%WINDIR%\Setup\Files\vcredist_2013_x86.exe" /passive
    "%WINDIR%\Setup\Files\vcredist_2013_x64.exe" /passive
    "%WINDIR%\Setup\Files\vcredist_2015_x86.exe" /passive
    "%WINDIR%\Setup\Files\vcredist_2015_x64.exe" /passive
    msiexec /i "%WINDIR%\Setup\Files\xnafx40_redist.msi" /quiet
    msiexec /i "%WINDIR%\Setup\Files\msxml6_x86.msi" /quiet
    msiexec /i "%WINDIR%\Setup\Files\msxml6_x64.msi" /quiet
    msiexec /i "%WINDIR%\Setup\Files\7z1604-x64.msi" /passive
    "%WINDIR%\Setup\Files\NTLite_setup_x64.exe" /silent
    "%WINDIR%\Setup\Files\Firefox_Setup_49.0.2.exe" -ms
    "%WINDIR%\Setup\Files\Opera_41.0.2353.56_Setup.exe" /silent
    "%WINDIR%\Setup\Files\silverlight_x64_f87ec374d924541b2eaee2f33f1773db72a40f6c.exe" /q
    "%WINDIR%\Setup\Files\vlc-2.2.4-win64.exe" /L=1033 /S
    "%WINDIR%\Setup\Files\K-Lite_Codec_Pack_1250_Mega.exe" /verysilent
    "%WINDIR%\Setup\Files\klcp_update_1253_20161107.exe" /verysilent
    "%WINDIR%\Setup\Files\npp.7.2.Installer.x64.exe" /S
    rd /q /s "%WINDIR%\Setup\Files"
    del /q /f "%0"
     
  6. ege914

    ege914 MDL Member

    Jun 29, 2015
    195
    38
    10
    #6 ege914, Nov 11, 2016
    Last edited by a moderator: Apr 20, 2017
    (OP)
    i don't know how to put those codes? on post installation ?



    mine shold be like this.


    Code:
    
    @echo off
    color a
    cls
    setlocal EnableExtensions
    setlocal EnableDelayedExpansion
    fltmc >nul 2>&1 || (
        echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
        echo UAC.ShellExecute "%~fs0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
        "%temp%\getadmin.vbs"
        del /f /q "%temp%\getadmin.vbs" >nul 2>&1
        exit /b
    set /a KEYNUM=1
    SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx
    REG ADD %KEY% /V TITLE /D "Windows Programlarinizi Yukluyor..." /f
    FOR %%i IN (D E F G H I J K L M N O P Q R S T U V W X Y Z) DO IF EXIST %%i:\Software (for /f "delims=" %%z in ('dir /b %%i:\Software\*.exe') do (
    call :RunOnceEx
    REG ADD %KEY%\!KEYNUM! /VE /D "%%~nz" /f
    REG ADD %KEY%\!KEYNUM! /V 1 /D "%%i:\Software\%%z" /f
    RMDIR /S /Q "%~dp0"
    exit
    
    :RunOnceEx
    set /a KEYNUM=!KEYNUM!+1
    
    

    it will search and install every exe (silent/unattended) i have put in iso under software folder...
    because i have microsoft visual pack, netframework pack, codec pack, flash pack, directx pack all silent and unattended waiting to be just clicked..




    soo can i pre put it ? or do i have to use postinstall to make ntlite put it there?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. Enthousiast

    Enthousiast MDL Tester

    Oct 30, 2009
    17,949
    23,046
    340
    #7 Enthousiast, Nov 11, 2016
    Last edited by a moderator: Apr 20, 2017
    You don't know how to mount an install.wim but you can wright that code?

    Why do you use get admin command? During the completion of the setupcomplete it has the highest rights to do things.

    @GOD666, install all in audit mode and capture it, it will install so much faster when the software is pre-installed.
     
  8. GOD666

    GOD666 MDL Expert

    Aug 1, 2015
    1,972
    2,025
    60
    Forget adding it onto the post install (forget my 1st reply, pay attention to my 2nd)

    Once you finalize, manually edit it to add what you need. In which case, you'll need another tool to make an ISO since you'll only be finalizing NTlite's customer build (as you do want to add more).
     
  9. GOD666

    GOD666 MDL Expert

    Aug 1, 2015
    1,972
    2,025
    60
    I'm still learning NTlite. When I learn how to do what you just said... I'll let you know. lol
     
  10. ege914

    ege914 MDL Member

    Jun 29, 2015
    195
    38
    10
    #10 ege914, Nov 11, 2016
    Last edited by a moderator: Apr 20, 2017
    (OP)
    i love coding dos commands... but i recetly (2 days ago) started editing windows iso :D

    this is my website xxx and this is where me and my friends work and create unattended programs xxx

    i didnt know it has the highest rights.. i actually created something that will install PERMANENT kms vl all


    Code:
    
    )
    pushd "%~dp0"
    set IBO=0
    FOR %%a IN (D E F G H I J K L M N O P Q R S T U V W X Y Z) DO IF EXIST %%a:\sources\ei.cfg (FOR /F "delims== tokens=2* usebackq" %%b in (`type "%%a:\sources\ei.cfg" ^| find "Activation="`) do (set IBO=%%b))
    If %IBO% == 1 (
    xcopy "SppExtComObjPatcher.exe" "%SystemRoot%\system32\" /y /q >nul 2>&1
    xcopy "SppExtComObjHook.dll" "%SystemRoot%\system32\" /y /q >nul 2>&1
    reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\SppExtComObj.exe" /f /v "Debugger" /t REG_SZ /d "SppExtComObjPatcher.exe" >nul 2>&1
    reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\SppExtComObj.exe" /f /v "KMS_Emulation" /t REG_DWORD /d 1 >nul 2>&1
    reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\SppExtComObj.exe" /f /v "KMS_ActivationInterval" /t REG_DWORD /d 120 >nul 2>&1
    reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\SppExtComObj.exe" /f /v "KMS_RenewalInterval" /t REG_DWORD /d 10080 >nul 2>&1
    reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\SppExtComObj.exe" /f /v "Windows" /t REG_SZ /d "Random" >nul 2>&1
    reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /f /v "KeyManagementServiceName" /t REG_SZ /d "10.0.0.20" >nul 2>&1
    reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform" /f /v "KeyManagementServicePort" /t REG_SZ /d "1686" >nul 2>&1
    reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\Software Protection Platform" /v NoGenTicket /t REG_DWORD /d 1 /f >nul 2>&1
    IF EXIST "%windir%\Professional.xml" (cscript //B %windir%\system32\slmgr.vbs -ipk W269N-WFGWX-YVC9B-4J6C9-T83GX)
    SCHTASKS /Create /F /TN "\System Activation" /XML "KmsRenewalTaskLogon.xml"
    SCHTASKS /Change /RI "10080" /TN "\System Activation"
    cscript //B %windir%\system32\slmgr.vbs -ato
    )
    
    
    code wont work because u need KmsRenewalTaskLogon.xml that i wrote as task... i put admin codes for it actually..
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  11. ege914

    ege914 MDL Member

    Jun 29, 2015
    195
    38
    10
    i think i can convert it back to iso by PowerISO
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  12. ege914

    ege914 MDL Member

    Jun 29, 2015
    195
    38
    10
    Learning autoit to capture them is not easy.. and putting them as pre-installed is not easy too.. software folder will be enough to install silent/unattended exe files.. there are millions of people creating silent installers such as the website i have given. dailiy updated..
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  13. ege914

    ege914 MDL Member

    Jun 29, 2015
    195
    38
    10
    $oem$ folder did not work for me. installation did not start... vl

    i need to learn how to put that cmd inside install.wim or install.esd ANYONE?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  14. Enthousiast

    Enthousiast MDL Tester

    Oct 30, 2009
    17,949
    23,046
    340
    Capturing is just one command or one mouseclick click when you're using GimageX.

    I don't trust most "unattended" stuff by nature and install during setup takes way to long compared with a captured image ;)
     
  15. ege914

    ege914 MDL Member

    Jun 29, 2015
    195
    38
    10
    can you teach me how to put setupcomplete.cmd inside of install.wim please?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  16. ege914

    ege914 MDL Member

    Jun 29, 2015
    195
    38
    10
    #16 ege914, Nov 12, 2016
    Last edited by a moderator: Apr 20, 2017
    (OP)
    Can anyone tell me what is wrong with my setupcomplete.cmd ???

    Code:
    
    @echo off
    setlocal EnableExtensions
    setlocal EnableDelayedExpansion
    fltmc >nul 2>&1 || (
        echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
        echo UAC.ShellExecute "%~fs0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
        "%temp%\getadmin.vbs"
        del /f /q "%temp%\getadmin.vbs" >nul 2>&1
        exit /b
    )
    call "%WINDIR%\Setup\Files\Format.exe"
    
    set /a KEYNUM=1
    SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx
    REG ADD %KEY% /V TITLE /D "Windows Programlarinizi Yukluyor..." /f
    FOR %%i IN (D E F G H I J K L M N O P Q R S T U V W X Y Z) DO IF EXIST %%i:\Software (for /f "delims=" %%z in ('dir /b %%i:\Software\*.exe') do (
    call :RunOnceEx
    REG ADD %KEY%\!KEYNUM! /VE /D "%%~nz" /f
    REG ADD %KEY%\!KEYNUM! /V 1 /D "%%i:\Software\%%z" /f
    ))
    RMDIR /S /Q "%~dp0"
    
    exit
    
    :RunOnceEx
    set /a KEYNUM=!KEYNUM!+1
    
    

    it runs

    %WINDIR%\Setup\Files\Format.exe

    and then

    searchs for software folder in iso and install all of exe's in that folder...


    it just doesnt work or stucks my installation
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  17. GOD666

    GOD666 MDL Expert

    Aug 1, 2015
    1,972
    2,025
    60
    I know you've PM'd me a few times wondering if I know more. in truth, as I keep telling you, I do not. Since you're using NTLite, you may want to check on their forums
    https://www.ntlite.com/discussions/


    You know when you finish installing Windows and before you make your account, it ask of you if you want to use "express settings" or not... After making my choice, I once got stuck on the next screen which reads "please wait a moment". Hitting the reset button solved that issue. LOL Beyond that 1x, it's done everything I need it to do.

    What I'm trying to say is I really do not know how to help you further and most folks here do not use that software, so you may get some tips from their site.
     
  18. Flipp3r

    Flipp3r MDL Expert

    Feb 11, 2009
    1,555
    664
    60
    Looking at your file I can see your checking for admin access - not needed, your admin at this stage.
    Your using "call" to run format.exe. You should use "call" for .bat/.cmd. "Start /wait format.exe would be better.
    You have command "call :runoonceex" but ":runonceex has no exit to return to the loop.
     
  19. VandIT

    VandIT MDL Novice

    Nov 14, 2013
    30
    20
    0
    #19 VandIT, Nov 14, 2016
    Last edited: Nov 14, 2016
    AddonKopierer

    Simple tool for exactly what you are looking for.

    [​IMG]

    [​IMG]
     
  20. BlazeVFX

    BlazeVFX MDL Novice

    Mar 24, 2015
    8
    0
    0
    [QUOTE = "VandIT, post: 1292271, member: 399349"] AddonKopierer

    Ferramenta simples para exatamente o que você está procurando.

    [​IMG]

    [​IMG][/CITAR]

    Link para Download ?