Install reg setting during install???

Discussion in 'Windows 7' started by lunar21, Aug 11, 2009.

  1. lunar21

    lunar21 MDL Addicted

    Dec 14, 2008
    755
    267
    30
    Hello all. I was wondering if there is a way to install a reg. file during windows 7 install? For the logo option to work you need to install a reg file. So I need to know where I would put the reg file and if I need to make a .cmd or .bat file and where that would go.

    Please I would much like it if someone would help me out with this.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. mirkocosta

    mirkocosta MDL Novice

    Jul 29, 2009
    15
    0
    0
    create a .bat script "SetupComplete.cmd" in <your root dvd/image path>\$OEM$\$$\SETUP\SCRIPTS\

    this will allow you to inject any command, ie: registry - at user's 1st logon
     
  3. mor

    mor MDL Novice

    Jul 16, 2009
    14
    0
    0
    If I have .reg file How do I write the script
     
  4. lunar21

    lunar21 MDL Addicted

    Dec 14, 2008
    755
    267
    30
    I already have a file called that for the install of the loader at bootup. Is there a way to add it into the file? I have attached the file, if you all could help me out that would be wonderful :)
     

    Attached Files:

    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. TheSickman

    TheSickman MDL Novice

    Aug 7, 2009
    40
    1
    0
    put ur reg file in the scripts folder

    ad line in SetupComplete.cmd


    REGEDIT /S %systemroot%\setup\scripts\your-reg.reg
     
  6. mor

    mor MDL Novice

    Jul 16, 2009
    14
    0
    0
    #6 mor, Aug 11, 2009
    Last edited by a moderator: Apr 20, 2017
    I add to lunar21 scripts
    Code:
    @ECHO OFF
    
    
    :START
    
    
    :FINDPARTITION
    For /F "tokens=2" %%I IN ('ECHO LIST VOL ^| DISKPART ^| FINDSTR /R /C:"[0-9]    [^Aa-Zz][^Aa-Zz]  ...........* *NTFS *.......... *[12]00 M.  "') DO CALL :PARSE %%I
    GOTO :INSTALL
    
    
    :PARSE
    SET FREEDRIVELETTER=0
    FOR %%p IN (B C D E F G H I J K L M N O P Q R S T U V W X Y Z) DO (
       ECHO LIST VOL | DISKPART | FINDSTR /C:"     %%p   " >nul
       IF ERRORLEVEL 1 SET FREEDRIVELETTER=%%p
    )
       IF %FREEDRIVELETTER%==0 GOTO :NOFREEDRIVES
       ECHO SELECT VOLUME %1 > "%TEMP%\MOUNT"
       ECHO ASSIGN LETTER=%FREEDRIVELETTER% >> "%TEMP%\MOUNT"
       ECHO SELECT VOLUME %1 > "%TEMP%\UNMOUNT"
       ECHO REMOVE >> "%TEMP%\UNMOUNT"
    GOTO :EOF
    
    
    :NOFREEDRIVES
    CALL :CLEANUP & EXIT
    
    
    :INSTALL
    IF EXIST "%TEMP%\MOUNT" DISKPART /S "%TEMP%\MOUNT" >nul
    FOR %%A IN (B: C: 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\bootmgr (
          IF NOT EXIST "%%A\autorun.inf" (
    COPY /b "%~dp0w7ldr1" + "%~dp0slic" + "%~dp0w7ldr2" %%A\w7ldr
    IF EXIST %%A\w7ldr ATTRIB %%A\w7ldr +h +s +r
    "%~dp0bootinst.exe" /nt60 %%A
    cscript //NOLOGO %SYSTEMROOT%\System32\slmgr.vbs -ipk *****-*****-*****-*****-*****
    cscript //NOLOGO %SYSTEMROOT%\System32\slmgr.vbs -ilc "%~dp0cert.xrm-ms"
    )
          )
       ) >nul
    IF EXIST "%TEMP%\UNMOUNT" DISKPART /S "%TEMP%\UNMOUNT" >nul
    CALL :CLEANUP & GOTO :FINISH
    
    
    :CLEANUP
    IF EXIST "%TEMP%\UNMOUNT" DEL /Q "%TEMP%\UNMOUNT"
    IF EXIST "%TEMP%\MOUNT" DEL /Q "%TEMP%\MOUNT"
    GOTO :EOF
    
    REGEDIT /S %systemroot%\setup\scripts\reg.reg
    
    :FINISH
    SHUTDOWN /R /T 30
    EXIT
    After installation it's not running the reg file
     
  7. JFMuggs

    JFMuggs MDL Member

    Jan 13, 2009
    181
    1
    10
    The line you added:

    REGEDIT /S %systemroot%\setup\scripts\reg.reg

    is orphaned. It sits right after a GOTO :EOF, so it never gets executed.
     
  8. EclipseSin

    EclipseSin MDL Member

    Feb 29, 2008
    218
    11
    10
    goto :eof = goto end of file? Just wondering because Im going to modify this thing for an oem sources folder rar for different manufacturers using Orbit's toolkit for the oem files
     
  9. mor

    mor MDL Novice

    Jul 16, 2009
    14
    0
    0
    I want to add software and I need to run the registry file to add settings
     
  10. JFMuggs

    JFMuggs MDL Member

    Jan 13, 2009
    181
    1
    10
    You've got it.
     
  11. myexige

    myexige MDL Novice

    Jul 30, 2009
    17
    0
    0
    actually in that script there is no label :EOF!

    Move your command after :FINISH and before the SHUTDOWN command
     
  12. JFMuggs

    JFMuggs MDL Member

    Jan 13, 2009
    181
    1
    10
    :EOF is an implicit/built-in label.
     
  13. JFMuggs

    JFMuggs MDL Member

    Jan 13, 2009
    181
    1
    10
    Maybe any/all scripts in that folder get run.
     
  14. lunar21

    lunar21 MDL Addicted

    Dec 14, 2008
    755
    267
    30
    #15 lunar21, Aug 12, 2009
    Last edited by a moderator: Apr 20, 2017
    (OP)
    Just to make sure i placed it in 2 places and it worked. I do not know which one worked but it does!!!:

    1. in the SetupComplete.cmd file:

    Code:
    @ECHO OFF
    
    
    :START
    
    REGEDIT /S %systemroot%\setup\scripts\acer.reg 
    
    :FINDPARTITION
    For /F "tokens=2" %%I IN ('ECHO LIST VOL ^| DISKPART ^| FINDSTR /R /C:"[0-9]    [^Aa-Zz][^Aa-Zz]  ...........* *NTFS *.......... *[12]00 M.  "') DO CALL :PARSE %%I
    GOTO :INSTALL
    
    
    :PARSE
    SET FREEDRIVELETTER=0
    FOR %%p IN (B C D E F G H I J K L M N O P Q R S T U V W X Y Z) DO (
       ECHO LIST VOL | DISKPART | FINDSTR /C:"     %%p   " >nul
       IF ERRORLEVEL 1 SET FREEDRIVELETTER=%%p
    )
       IF %FREEDRIVELETTER%==0 GOTO :NOFREEDRIVES
       ECHO SELECT VOLUME %1 > "%TEMP%\MOUNT"
       ECHO ASSIGN LETTER=%FREEDRIVELETTER% >> "%TEMP%\MOUNT"
       ECHO SELECT VOLUME %1 > "%TEMP%\UNMOUNT"
       ECHO REMOVE >> "%TEMP%\UNMOUNT"
    GOTO :EOF

    2. And in the OOBE.CMD file:

    Code:
    regedit /s %systemroot%\setup\scripts\acer.reg
    %systemroot%\setup\scripts\system.cmd
    
    
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...