$OEM$ custom installation

Discussion in 'Windows 10' started by allmythy, Jan 7, 2019.

  1. allmythy

    allmythy MDL Member

    Feb 15, 2010
    105
    14
    10
    i have created $oem$\$1\unattended folder in ...\sources folder.
    it copy the unattended folder in c:\
    i need to run automatically a file c:\unattended\install.cmd at the first time windows goes to desktop
    i've tried some solutions but i'm not so good :)
    someone helps me ?
     
  2. Enthousiast

    Enthousiast MDL Tester

    Oct 30, 2009
    22,956
    32,038
    390
    The standard structure for using $OEM$ folder is:
    Code:
    $OEM$\$$\Setup\Scripts
    Put the $OEM$ folder inside the "ISO:\Sources" folder and the script should be called setupcomplete.cmd, for automated running of the script.

    Now all content of the "$OEM$\$$\Setup\Scripts" folder will be copied to "c:\windows\setup\scripts" and the setupcomplete.cmd will run automated with the highest system rights.

    Like the $OEM$ folder from KMS_VL_ALL v28, i believe i showed you before.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. s1ave77

    s1ave77 Has left at his own request

    Aug 15, 2012
    16,134
    24,010
    340
    Quite easy :D.

    To process files during setup, it needs the Scripts folder as mentioned by @Enthousiast above. Create a file named setupcomplete.cmd and place in that folder.

    Content of setupcomplete.cmd:
    Code:
    @echo off
    pushd "%~dp0"
    cd %~dp0
    Reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx" /v Title /t REG_SZ /d BootTask /f
    Reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx" /v Flags /t REG_DWORD /d 2 /f
    Reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\0001" /v MyScript /t REG_SZ /d "%windir%\Setup\Scripts\install.cmd" /f
    exit
    
    Place your install.cmd script beside setupcomplete.cmd.

    The RunOnceEx task will run one time at first user boot after setup.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. allmythy

    allmythy MDL Member

    Feb 15, 2010
    105
    14
    10
    #4 allmythy, Jan 8, 2019
    Last edited: Jan 8, 2019
    (OP)
    i'm testing...
     
  5. allmythy

    allmythy MDL Member

    Feb 15, 2010
    105
    14
    10
    thank you guys all goes ritght :)