Jump to content

George King

Members
  • Posts

    470
  • Joined

  • Last visited

  • Days Won

    18

Posts posted by George King

  1. You cannot use a changing environment variable in a script loop without using "SETLOCAL EnableDelayedExpansion".

    Try the following code:

    SETLOCAL EnableDelayedExpansion

    echo Adding registry tweaks to enable RunOnceEx for install Special Updates...

    REG LOAD HKLM\Slipstream "%WIM%\Windows\System32\Config\Software" >nul
    SET ROE=HKLM\Slipstream\Microsoft\Windows\CurrentVersion\RunOnceEx

    REG ADD %ROE% /v TITLE /d "Installing updates" /f >nul
    REG ADD %ROE% /v Flags /t REG_DWORD /d "00000014" /f >nul
    REG ADD %ROE% /d "%WinDir%\System32\rundll32.exe %WinDir%\System32\iernonce.dll,RunOnceExProcess" /f >nul

    cd SpecialUpdates
    set /a NUM=0
    if not exist "%WIM%\Windows\Setup\Updates" mkdir "%WIM%\Windows\Setup\Updates" >nul
    FOR %%f IN ("*.*") DO (
    set /a ROENUM=!NUM!*5
    If !ROENUM! LSS 10 (set "ROESTR=00!ROENUM!") ELSE (
    If !ROENUM! LSS 100 (set "ROESTR=0!ROENUM!") ELSE (
    set "ROESTR=!ROENUM!"))

    copy /Y "%%f" "%WIM%\Windows\Setup\Updates"
    REG ADD %ROE%\!ROESTR! /ve /d "%%f" /f
    REG ADD %ROE%\!ROESTR! /v %%f /d "%WinDir%\Setup\Updates\%%f /q" /f
    set /a NUM+=1
    echo. File !NUM! processed as !ROESTR!: "%%f"
    )
    echo.
    echo !NUM! files added to ROE.
    echo.
    pause
    REG UNLOAD HKLM\Slipstream
    cd..

    This script will properly handle up to 200 files with standard ROE numbering (multiples of 5, starting at 0).

    And, yes, the exclamation points (!) are absolutely necessary for environment variables that change with EnableDelayedExpansion.

    Wow, it working :thumbsup_anim: . Many thanks.

    Can you specify for me this code? I´m not sure if understand it...

     set /a ROENUM=!NUM!*5
    If !ROENUM! LSS 10 (set "ROESTR=00!ROENUM!") ELSE (
    If !ROENUM! LSS 100 (set "ROESTR=0!ROENUM!") ELSE (
    set "ROESTR=!ROENUM!"))

  2. echo Adding registry weaks to enable RunOnceEx for install Special Updates...

    REG LOAD HKLM\Slipstream "%WIM%\Windows\System32\Config\Software" >nul
    SET ROE=HKLM\Slipstream\Microsoft\Windows\CurrentVersion\RunOnceEx

    REG ADD %ROE% /v TITLE /d "Installing updates" /f >nul
    REG ADD %ROE% /v Flags /t REG_DWORD /d "00000014" /f >nul
    REG ADD %ROE% /d "%WinDir%\System32\rundll32.exe %WinDir%\System32\iernonce.dll,RunOnceExProcess" /f >nul

    cd SpecialUpdates
    set /a NUM=0
    if not exist "%WIM%\Windows\Setup\Updates" mkdir "%WIM%\Windows\Setup\Updates" >nul
    FOR %%f IN ("*.*") DO (
    copy /Y "%%f" "%WIM%\Windows\Setup\Updates"
    REG ADD %ROE%\00%NUM% /ve /d "%%f" /f
    REG ADD %ROE%\00%NUM% /v %%f /d "%WinDir%\Setup\Updates\%%f /q" /f
    goto :increase
    )
    echo %NUM%

    pause
    REG UNLOAD HKLM\Slipstream
    cd..

    :increase
    set /a NUM+=1
    goto :eof

    try this

    when i was working on WLM i remember that the for didn't increase until it gets out from the loop

    i fixed it that way i think

    try it and tell me

    Not working, look:

    fwj0jo.png

    The script will exit without REG UNLOAD etc and FOR was run only for one time, it must run 3 times (in folder are 3 updates)

    Any ideas?

  3. Hi, i´m working on new Windows 7 Update Pack Tool and i wrote this:

    echo Adding registry weaks to enable RunOnceEx for install Special Updates...

    REG LOAD HKLM\Slipstream "%WIM%\Windows\System32\Config\Software" >nul
    SET ROE=HKLM\Slipstream\Microsoft\Windows\CurrentVersion\RunOnceEx

    REG ADD %ROE% /v TITLE /d "Installing updates" /f >nul
    REG ADD %ROE% /v Flags /t REG_DWORD /d "00000014" /f >nul
    REG ADD %ROE% /d "%WinDir%\System32\rundll32.exe %WinDir%\System32\iernonce.dll,RunOnceExProcess" /f >nul

    cd SpecialUpdates
    set /a NUM=0
    if not exist "%WIM%\Windows\Setup\Updates" mkdir "%WIM%\Windows\Setup\Updates" >nul
    FOR %%f IN ("*.*") DO (
    copy /Y "%%f" "%WIM%\Windows\Setup\Updates"
    REG ADD %ROE%\00%NUM% /ve /d "%%f" /f
    REG ADD %ROE%\00%NUM% /v %%f /d "%WinDir%\Setup\Updates\%%f /q" /f
    set /a NUM+=1
    )
    echo %NUM%

    pause
    REG UNLOAD HKLM\Slipstream
    cd..

    Writing into registry works, but under HKLM\Slipstream\Microsoft\Windows\CurrentVersion\RunOnceEx is only one key 000 i´m used set /a NUM=0 and set /a NUM+=1 in FOR, but i don´t know why REG ADD %ROE%\00%NUM% /ve /d "%%f" /f not working if i make echo %NUM% it give me 3 (in folder are 3 Updates). Don´t know why script write only 000 key. I think it must write key 000, 001, 002

    4gqe12.png

  4. To BillGates_XP:

    Can you make TXT file (or write on board) text which are on BMPs and AVIS which i uploaded? I prefer writing russian text on board into code box



    Here is link for BMPs and AVIs with russian text:

    http://www.mediafire.com/file/v11zwxzy1nz/NeedTranslateAVI-BMP.7z

    P.S. If is possible, please do it like this...

    access.cpl

    2011 - TEXT
    2021 - TEXT

    appwiz.cpl

    101 - TEXT

    ect ect...

    Many thanks.

    To MANIKANT.S.GUPTA:

    I will send you PM, after BillGates_XP give us russian text and after i translate it into english...

×
×
  • Create New...