Update your Win 7 installation media

Page 30 of 144 FirstFirst ... 20282930313240130 ... LastLast

  1. Posts : 16,163
    7 X64
    Thread Starter
       #291

    OK, now the question:
    I want to do a loop with "for"cmd
    - %n% now has the number of images on install.wim
    - How do I do a "for"cmd to do %wimlib% info %TP%\Wim_Files\install.wim x
    where x is 1, 2, ..n

    Code:
    ::output wimlib info for all images to screen
    
    for /l %%a in (1,1,%n%) do %WimLib% info "%TP%\Wim_Files\install.wim" %%a
    
    pause
    
    ::output wimlib info for all images to a text file:
    
    for /l %%a in (1,1,%n%) do %WimLib% info "%TP%\Wim_Files\install.wim" %%a >>wiminfo.txt
    
    ::read it
    
    notepad wiminfo.txt
    Last edited by SIW2; 24 Apr 2019 at 14:07.
      My Computers


  2. Posts : 16,163
    7 X64
    Thread Starter
       #292

    A way round that is to put the pack date in the displayname

    %wimlib% info "V:\ISOx64\sources\install.wim" 1 --image-property "DISPLAYNAME=Windows 7 Home Basic %packdate%"


    Update your Win 7 installation media-displayname-packdate.jpg
    Last edited by SIW2; 24 Apr 2019 at 18:02.
      My Computers


  3. Posts : 7,351
    Windows 7 HP 64
       #293

    Megahertz07 said:
    SEW2, another help.

    If i do a cmd
    %wimlib% info %TP%\Wim_Files\install.wim
    it will list all info of install.wim

    If i do a cmd
    %wimlib% info %TP%\Wim_Files\install.wim 3
    it will list info of image 3 of install.wim

    OK, now the question:
    I want to do a loop with "for"cmd
    - %n% now has the number of images on install.wim
    - How do I do a "for"cmd to do %wimlib% info %TP%\Wim_Files\install.wim x
    where x is 1, 2, ..n

    Thanks
    Thanks
    Rem (1,1,%n%) = start, increment, end
    for /L %%A in (1,1,%n%) do (
    REM --Code goes here--
    )

    So it would be
    for /L %%A in (1,1,%n%) do (
    %wimlib% info %TP%\Wim_Files\install.wim %%A
    )
      My Computers


  4. Posts : 16,163
    7 X64
    Thread Starter
       #294

    You can do it on one line:

    for /l %%a in (1,1,%n%) do %WimLib% info "%TP%\Wim_Files\install.wim" %%a
      My Computers


  5. Posts : 7,351
    Windows 7 HP 64
       #295

    Mega is back again.
    I'm having problems with :setedn
    - It does the job for HP(2) but when it comes to Pro(3) and Ultimate(4) it says that there is already a mounted image on NTempdir.
    I remember this issue when I made my drivers integration on 2016. Even when you un mount an image it may say that there is still something unmounted.

    - Can I do the following (I don't like &) ?
    :setedn
    ECHO.
    setlocal DisableDelayedExpansion
    start "Setting Editions Windows" /wait cmd.exe /v/c "@echo off & (for /l %%a in (2,1,%n%) do (
    %DISM% /Mount-Wim /WimFile:"%TP%\Wim_Files\$install.wim" /Index:"%%a" /MountDir:"%NTempdir%"
    %DISM% /Image:"%NTempdir%" /Set-Edition:!ned_%%a!
    call "bin\clean7.cmd"
    %DISM% /Unmount-Wim /MountDir:"%NTempdir%" /Commit
    RD /S /Q %TP%\Temp 2>nul
    2>nul md "Temp\Temp"
    2>nul md "Temp\Temp_N"
    )
    )"
    endlocal
      My Computers


  6. Posts : 16,163
    7 X64
    Thread Starter
       #296

    Or you can check for mounted images and try and cleanup beforehand.

    Code:
    (set ismounted=)
    for /f "usebackq tokens=1,2,3 delims=:" %%G in (`%dism% /get-mountedwiminfo ^| find /i "mount"`) do set ismounted=%%I
    IF NOT "%ismounted%"=="" (
    	echo  Image mounted Trying cleanup
            %dism% /unmount-Wim /MountDir:"mount" /discard
    	rd /s /q "mount" > nul
    	%dism% /cleanup-wim 
    )
    Replace "mount" with "uptemp" or whatever your mount folder is.

    Even when you un mount an image it may say that there is still something unmounted.
    That can happen if you have something open on the mount folder - an explorer window maybe.
      My Computers


  7. Posts : 7,351
    Windows 7 HP 64
       #297

    - It does the job for HP(2) but when it comes to Pro(3) and Ultimate(4) it says that there is already a mounted image on NTempdir.

    It explain why I was having Edition ID = HOMEBASIC on PRO and Ultimate (post 264).

    I will create a CleanMount.cmd and call it every time I un mount an image.

    Is there any reason why you mount boot.wim and install.wim on mount folder and mount $install.wim in NTempdir folder?

    Thanks.
    Last edited by Megahertz07; 25 Apr 2019 at 09:29.
      My Computers


  8. Posts : 16,163
    7 X64
    Thread Starter
       #298

    Is there any reason why you mount boot.wim and install.wim on mount folder and mount $install.wim in NTempdir folder?
    You can use whatever mount folders you like.
      My Computers


  9. Posts : 16,163
    7 X64
    Thread Starter
       #299

    v22F on first post.
      My Computers


  10. Posts : 7,351
    Windows 7 HP 64
       #300

    SIW2, don't know how to thank you for your patience to teach me.

    At the beginning of :MountBootWim and :MountInstallWim I added this cmd line:
    IF not exist %MountDir% MD %MountDir% 2>nul
    and
    after un mounting I added this cmd line:
    If Not exist "%TP%\Temp\CleanMount.cmd" IF EXIST "bin\CleanMount.cmd" COPY /Y "bin\CleanMount.cmd" "%tp%\Temp\"
    If exist "%TP%\Temp\CleanMount.cmd" CALL "%TP%\Temp\CleanMount.cmd"

    CleanMount.cmd is
    cd /d "%TP/Temp%"
    %Dism% /unmount-Wim /MountDir:%MountDir% /discard
    %DISM% /cleanup-wim
    rd /s /q %MountDir% > nul
    cd /d "%TP%"

    :setedn
    ECHO.
    If Not exist "%TP%\Temp\CleanWim.cmd" IF EXIST "bin\CleanWim.cmd" COPY /Y "bin\CleanWim.cmd" "%tp%\Temp\"
    If Not exist "%TP%\Temp\CleanMount.cmd" IF EXIST "bin\CleanMount.cmd" COPY /Y "bin\CleanMount.cmd" "%tp%\Temp\"

    setlocal DisableDelayedExpansion
    start "Setting Editions Windows" /wait cmd.exe /v/c "@echo off & (for /l %%a in (2,1,%n%) do IF not exist %MountDir% MD %MountDir% & %DISM% /Mount-Wim /WimFile:"%TP%\Wim_Files\$install.wim" /Index:"%%a" /MountDir:"%MountDir%" & %DISM% /Image:"%MountDir%" /Set-Edition:!ned_%%a! & call "Temp\CleanWim.cmd" & %DISM% /Unmount-Wim /MountDir:"%MountDir%" /Commit & Call %TP%\Temp\CleanMount)"
    endlocal

    Temp\CleanWim.cmd is the Clean7.cmd with SET MOUNT=%MountDir% and I use on :MountBootWim and :MountInstallWim and %MountDir%=%TP%\Temp

    It's working without errors for the first time.
    Thanks again.
      My Computers


 
Page 30 of 144 FirstFirst ... 20282930313240130 ... LastLast

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 17:31.
Find Us