Loop through folder of multiple wim's

Discussion in 'Windows 8' started by hypedave, Nov 11, 2014.

  1. hypedave

    hypedave MDL Member

    Oct 14, 2014
    130
    30
    10
    #121 hypedave, Nov 21, 2014
    Last edited by a moderator: Apr 20, 2017
    (OP)
    Ok thanks. I will play with this later tonight and report back the source code and results.

     
  2. s1ave77

    s1ave77 Has left at his own request

    Aug 15, 2012
    16,092
    24,400
    340
    Yeah, some painfull doubling + copy 'n paste :cool2:. Report feedback :good3:.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. hypedave

    hypedave MDL Member

    Oct 14, 2014
    130
    30
    10
    #123 hypedave, Nov 21, 2014
    Last edited by a moderator: Apr 20, 2017
    (OP)
    Am I headed in the right path?

    Code:
    :: Path to Windows 7 x64 Make & Model Driver Store
    set "driversw7x64=e:\drivers\Windows 7 x64\Dell Inc"
    set "driversw7x64=e:\drivers\Windows 7 x64\Hewlett-Packard"
    set "driversw7x64=e:\drivers\Windows 7 x64\Lenovo"
    set "driversw7x64=e:\drivers\Windows 7 x64\Microsoft Corporation"
    set "driversw7x64=e:\drivers\Windows 7 x64\Samsung"
    set "driversw7x64=e:\drivers\Windows 7 x64\Toshiba"
    :: Path to Windows 7 x86 Make & Model Driver Store
    set "driversw7x86=e:\drivers\Windows 7 x86\Dell Inc"
    set "driversw7x86=e:\drivers\Windows 7 x86\Hewlett-Packard"
    set "driversw7x86=e:\drivers\Windows 7 x86\Lenovo"
    set "driversw7x86=e:\drivers\Windows 7 x86\Microsoft Corporation"
    set "driversw7x86=e:\drivers\Windows 7 x86\Samsung"
    set "driversw7x86=e:\drivers\Windows 7 x86\Toshiba"
    :: Path to Windows 8 x64 Make & Model Driver Store
    set "driversw8x64=e:\drivers\Windows 8 x64\Dell Inc"
    set "driversw8x64=e:\drivers\Windows 8 x64\Hewlett-Packard"
    set "driversw8x64=e:\drivers\Windows 8 x64\Lenovo"
    set "driversw8x64=e:\drivers\Windows 8 x64\Microsoft Corporation"
    set "driversw8x64=e:\drivers\Windows 8 x64\Samsung"
    set "driversw8x64=e:\drivers\Windows 8 x64\Toshiba"
    :: Path to Windows 8 x86 Make & Model Driver Store
    set "driversw8x86=e:\drivers\Windows 8 x86\Dell Inc"
    set "driversw8x86=e:\drivers\Windows 8 x86\Hewlett-Packard"
    set "driversw8x86=e:\drivers\Windows 8 x86\Lenovo"
    set "driversw8x86=e:\drivers\Windows 8 x86\Microsoft Corporation"
    set "driversw8x86=e:\drivers\Windows 8 x86\Samsung"
    set "driversw8x86=e:\drivers\Windows 8 x86\Toshiba"
    :: Path to Windows 8.1 x64 Make & Model Driver Store
    set "driversw81x64=e:\drivers\Windows 8.1 x64\Dell Inc"
    set "driversw81x64=e:\drivers\Windows 8.1 x64\Hewlett-Packard"
    set "driversw81x64=e:\drivers\Windows 8.1 x64\Lenovo"
    set "driversw81x64=e:\drivers\Windows 8.1 x64\Microsoft Corporation"
    set "driversw81x64=e:\drivers\Windows 8.1 x64\Samsung"
    :: Path to Windows 8.1 x86 Make & Model Driver Store
    set "driversw81x86=e:\drivers\Windows 8.1 x64\Toshiba"
    set "driversw81x86=\drivers\Windows 8.1 x86\Dell Inc"
    set "driversw81x86=\drivers\Windows 8.1 x86\Hewlett-Packard"
    set "driversw81x86=\drivers\Windows 8.1 x86\Lenovo"
    set "driversw81x86=\drivers\Windows 8.1 x86\Microsoft Corporation"
    set "driversw81x86=\drivers\Windows 8.1 x86\Samsung"
    set "driversw81x86=\drivers\Windows 8.1 x86\Toshiba"
    Code:
    echo %%a | find "w81u1x64_Dell_Latitude_3340" 1>nul && Dism /Image:"F:\mount" /Add-Driver /Driver:"%driversw8.1x64%\Dell\Latitude 3340" /Recurse /ForceUnsigned
     
  4. s1ave77

    s1ave77 Has left at his own request

    Aug 15, 2012
    16,092
    24,400
    340
    It should be enough to set only the Win version folders, then define Vendor and Model directly in the find command line (at the end), according to real folder names. No need to set all subfolders.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. hypedave

    hypedave MDL Member

    Oct 14, 2014
    130
    30
    10
    #125 hypedave, Nov 21, 2014
    Last edited by a moderator: Apr 20, 2017
    (OP)
    So something much simplier to this?

    Code:
    :: Path to Windows 7 x64 Make & Model Driver Store
    set driversw7x64=e:\drivers\Windows 7 x64
    :: Path to Windows 8 x64 Make & Model Driver Store
    set driversw8x64=e:\drivers\Windows 8 x64
    :: Path to Windows 8 x86 Make & Model Driver Store
    set driversw8x86=e:\drivers\Windows 8 x86
    :: Path to Windows 8.1 x64 Make & Model Driver Store
    set driversw81x64=e:\drivers\Windows 8.1 x64
    :: Path to Windows 8.1 x86 Make & Model Driver Store
    set driversw81x86=e:\drivers\Windows 8.1 x64
    
    Code:
    echo %%a | find "w81u1x64_Dell_Latitude_3340" 1>nul && Dism /Image:"e:\mount" /Add-Driver /Driver:"%driversw8.1x64%\Dell\Latitude 3340" /Recurse /ForceUnsigned
     
  6. hypedave

    hypedave MDL Member

    Oct 14, 2014
    130
    30
    10
    #126 hypedave, Nov 21, 2014
    Last edited by a moderator: Apr 20, 2017
    (OP)
    So something cleaner like this then

    Code:
    :: Path to Windows 7 x64 Make & Model Driver Store
    set driversw7x64=e:\drivers\Windows 7 x64
    :: Path to Windows 8 x64 Make & Model Driver Store
    set driversw8x64=e:\drivers\Windows 8 x64
    :: Path to Windows 8 x86 Make & Model Driver Store
    set driversw8x86=e:\drivers\Windows 8 x86
    :: Path to Windows 8.1 x64 Make & Model Driver Store
    set driversw81x64=e:\drivers\Windows 8.1 x64
    :: Path to Windows 8.1 x86 Make & Model Driver Store
    set driversw81x86=e:\drivers\Windows 8.1 x64
    Code:
    echo %%a | find "w81u1x64_Dell_Latitude_3340" 1>nul && Dism /Image:"e:\mount" /Add-Driver /Driver:"%driversw8.1x64%\Dell\Latitude 3340" /Recurse /ForceUnsigned
     
  7. s1ave77

    s1ave77 Has left at his own request

    Aug 15, 2012
    16,092
    24,400
    340
    #127 s1ave77, Nov 21, 2014
    Last edited by a moderator: Apr 20, 2017


    Name it exactly like the actual Vendor folder. You showed 'Dell Inc' so:
    Code:
    echo %%a | find "w81u1x64_Dell_Latitude_3340" 1>nul && Dism /Image:"e:\mount" /Add-Driver /Driver:"%driversw81x64%\Dell Inc\Latitude 3340" /Recurse /ForceUnsigned
    Rest is OK :good3:.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. s1ave77

    s1ave77 Has left at his own request

    Aug 15, 2012
    16,092
    24,400
    340
    Any progress to report ... :nsa:?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  9. hypedave

    hypedave MDL Member

    Oct 14, 2014
    130
    30
    10
    Oh yeah, trying it out in a few minutes actually.
     
  10. hypedave

    hypedave MDL Member

    Oct 14, 2014
    130
    30
    10
    #130 hypedave, Nov 23, 2014
    Last edited by a moderator: Apr 20, 2017
    (OP)
    Didn't work, skipped right past injecting drivers

    Code:
    @echo off
    :: get admin rights
    (NET FILE||(powershell -command Start-Process '%0' -Verb runAs -ArgumentList '%* '&EXIT /B))>NUL 2>&1
    setLocal EnableDelayedExpansion
    
    :: Get timestamp data: will show month.day.year.hour.min.sec
    for /f "skip=1 delims=" %%x in ('wmic os get localdatetime') do if not defined X set X=%%x
    :: Timestamp with seconds
    :: set timestamp=%X:~4,2%-%X:~6,2%-%X:~0,4%-%X:~8,2%-%X:~10,2%-%X:~12,2%
    :: Timestamp without seconds
    set timestamp=%X:~4,2%-%X:~6,2%-%X:~0,4%-%X:~8,2%-%X:~10,2%
    :: Exclude WIms from 
    set textfile=g:\wim\exclusions.txt
    :: Path to update packages group 1
    set updates1=g:\updates\Windows7-x64
    :: Path to update packages group 2
    set updates2=g:\updates\Windows7-x86
    :: Path to update packages group 3
    set updates3=g:\updates\Windows8-x64
    :: Path to update packages group 4
    set updates4=g:\updates\Windows8-x86
    :: Path to update packages group 5
    set updates5=g:\updates\Windows8.1-x64
    :: Path to update packages group 6
    set updates6=g:\updates\Windows8.1-x86
    
    :: Path to Windows 7 x64 Make & Model Driver Store
    set driversw7x64=g:\drivers\Windows 7 x64
    :: Path to Windows 8 x64 Make & Model Driver Store
    set driversw8x64=g:\drivers\Windows 8 x64
    :: Path to Windows 8 x86 Make & Model Driver Store
    set driversw8x86=g:\drivers\Windows 8 x86
    :: Path to Windows 8.1 x64 Make & Model Driver Store
    set driversw81x64=g:\drivers\Windows 8.1 x64
    :: Path to Windows 8.1 x86 Make & Model Driver Store
    set driversw81x86=g:\drivers\Windows 8.1 x64
    
    :: set compare files
    set "wimfile=g:\wim\wimlist.txt"
    set "deltafile=g:\wim\deltalist.txt"
    if exist %wimfile% del /s /q %wimfile% >nul
    if exist %deltafile% del /s /q %deltafile% >nul
    :: get WIM names from Folder
    for /r "g:\wim" %%a in (*.wim) do echo %%~na>>%wimfile%
    :: compare files and write difference to %deltafile%
    for /f "tokens=1 delims= " %%a in ('"powershell Compare-Object -ReferenceObject (Get-Content %textfile%) -DifferenceObject (Get-Content %wimfile%) ^| Format-Table -AutoSize" ^| findstr /i "=^>"') do echo %%a>>%deltafile%
    if not exist %deltafile% (
    echo No files to process found.
    echo:
    pause
    if exist %wimfile% del /s /q %wimfile% >nul
    exit
    )
    
    :: Path to files copy
    set path1=g:\files
    set target=g:\mount
    
    :: start procedure
    :: backup all WIMs to g:\backup\backup.wim
    echo.
    echo ===============================================================================
    echo Backing up to g:\backup\backup_%timestamp%.wim
    echo ===============================================================================
    echo.
    set "p=0"
    for /f "tokens=* delims= " %%a in (%deltafile%) do (
    echo Exporting %%a to g:\backup\backup.wim
    echo.
    Dism /Export-Image /SourceImageFile:g:\wim\%%a.wim /SourceIndex:1 /DestinationImageFile:g:\backup\backup_%timestamp%.wim /compress:max /CheckIntegrity
    )
    :: mount single WIMs to g:\mount, add updates and unmount/commit
    echo.
    echo ===============================================================================
    echo Mounting to g:\mount
    echo Adding Updates
    echo Unmount/Commit
    echo ===============================================================================
    echo.
    :: execute loop for deltas only
    for /f "tokens=* delims= " %%a in (%deltafile%) do (
    echo Processing %%a
    echo.
    DISM /mount-wim /wimfile:g:\wim\%%a.wim /index:1 /mountdir:g:\mount
    echo %%a | find "w81u1x64_ThinkPad_Yoga" 1>nul && Dism /Image:"g:\mount" /Add-Driver /Driver:"%driversw8.1x64%\Lenovo\ThinkPad Yoga" /Recurse /ForceUnsigned
    xcopy.exe %path1%\*.* %target%\*.* /s /d /e /h /r /k /y
    echo %%a | find "w7sp1x64" 1>nul && (
    set "a=0"&&set "b=0"&&set "c=0"&&set "d=0"&&set "e=0"&&set "f=0"
    for /r "%updates1%\Baseline" %%a in (*.*) do set /a a+=1
    for /r "%updates1%\General" %%a in (*.*) do set /a b+=1
    for /r "%updates1%\Hotfix" %%a in (*.*) do set /a c+=1
    for /r "%updates1%\Security" %%a in (*.*) do set /a d+=1
    for /r "%updates1%\Additional" %%a in (*.*) do set /a e+=1
    for /r "%updates1%\Extra" %%a in (*.*) do set /a f+=1
    if /i !a! gtr 0 DISM /image:g:\mount /Add-Package /PackagePath:%updates1%\Baseline
    if /i !b! gtr 0 DISM /image:g:\mount /Add-Package /PackagePath:%updates1%\General
    if /i !c! gtr 0 DISM /image:g:\mount /Add-Package /PackagePath:%updates1%\Hotfix
    if /i !d! gtr 0 DISM /image:g:\mount /Add-Package /PackagePath:%updates1%\Security
    if /i !e! gtr 0 DISM /image:g:\mount /Add-Package /PackagePath:%updates1%\Additional
    if /i !f! gtr 0 DISM /image:g:\mount /Add-Package /PackagePath:%updates1%\Extra
    )
    echo %%a | find "w7sp1x86" 1>nul && (
    set "a=0"&&set "b=0"&&set "c=0"&&set "d=0"&&set "e=0"&&set "f=0"
    for /r "%updates2%\Baseline" %%a in (*.*) do set /a a+=1
    for /r "%updates2%\General" %%a in (*.*) do set /a b+=1
    for /r "%updates2%\Hotfix" %%a in (*.*) do set /a c+=1
    for /r "%updates2%\Security" %%a in (*.*) do set /a d+=1
    for /r "%updates2%\Additional" %%a in (*.*) do set /a e+=1
    for /r "%updates2%\Extra" %%a in (*.*) do set /a f+=1
    if /i !a! gtr 0 DISM /image:g:\mount /Add-Package /PackagePath:%updates2%\Baseline
    if /i !b! gtr 0 DISM /image:g:\mount /Add-Package /PackagePath:%updates2%\General
    if /i !c! gtr 0 DISM /image:g:\mount /Add-Package /PackagePath:%updates2%\Hotfix
    if /i !d! gtr 0 DISM /image:g:\mount /Add-Package /PackagePath:%updates2%\Security
    if /i !e! gtr 0 DISM /image:g:\mount /Add-Package /PackagePath:%updates2%\Additional
    if /i !f! gtr 0 DISM /image:g:\mount /Add-Package /PackagePath:%updates2%\Extra
    )
    echo %%a | find "w8x64" 1>nul && (
    set "a=0"&&set "b=0"&&set "c=0"&&set "d=0"&&set "e=0"&&set "f=0"
    for /r "%updates3%\Baseline" %%a in (*.*) do set /a a+=1
    for /r "%updates3%\General" %%a in (*.*) do set /a b+=1
    for /r "%updates3%\Hotfix" %%a in (*.*) do set /a c+=1
    for /r "%updates3%\Security" %%a in (*.*) do set /a d+=1
    for /r "%updates3%\Additional" %%a in (*.*) do set /a e+=1
    for /r "%updates3%\Extra" %%a in (*.*) do set /a f+=1
    if /i !a! gtr 0 DISM /image:g:\mount /Add-Package /PackagePath:%updates3%\Baseline
    if /i !b! gtr 0 DISM /image:g:\mount /Add-Package /PackagePath:%updates3%\General
    if /i !c! gtr 0 DISM /image:g:\mount /Add-Package /PackagePath:%updates3%\Hotfix
    if /i !d! gtr 0 DISM /image:g:\mount /Add-Package /PackagePath:%updates3%\Security
    if /i !e! gtr 0 DISM /image:g:\mount /Add-Package /PackagePath:%updates3%\Additional
    if /i !f! gtr 0 DISM /image:g:\mount /Add-Package /PackagePath:%updates3%\Extra
    )
    echo %%a | find "w8x86" 1>nul && (
    set "a=0"&&set "b=0"&&set "c=0"&&set "d=0"&&set "e=0"&&set "f=0"
    for /r "%updates4%\Baseline" %%a in (*.*) do set /a a+=1
    for /r "%updates4%\General" %%a in (*.*) do set /a b+=1
    for /r "%updates4%\Hotfix" %%a in (*.*) do set /a c+=1
    for /r "%updates4%\Security" %%a in (*.*) do set /a d+=1
    for /r "%updates4%\Additional" %%a in (*.*) do set /a e+=1
    for /r "%updates4%\Extra" %%a in (*.*) do set /a f+=1
    if /i !a! gtr 0 DISM /image:g:\mount /Add-Package /PackagePath:%updates4%\Baseline
    if /i !b! gtr 0 DISM /image:g:\mount /Add-Package /PackagePath:%updates4%\General
    if /i !c! gtr 0 DISM /image:g:\mount /Add-Package /PackagePath:%updates4%\Hotfix
    if /i !d! gtr 0 DISM /image:g:\mount /Add-Package /PackagePath:%updates4%\Security
    if /i !e! gtr 0 DISM /image:g:\mount /Add-Package /PackagePath:%updates4%\Additional
    if /i !f! gtr 0 DISM /image:g:\mount /Add-Package /PackagePath:%updates4%\Extra
    )
    echo %%a | find "w81u1x64" 1>nul && (
    set "a=0"&&set "b=0"&&set "c=0"&&set "d=0"&&set "e=0"&&set "f=0"
    for /r "%updates5%\Baseline" %%a in (*.*) do set /a a+=1
    for /r "%updates5%\General" %%a in (*.*) do set /a b+=1
    for /r "%updates5%\Hotfix" %%a in (*.*) do set /a c+=1
    for /r "%updates5%\Security" %%a in (*.*) do set /a d+=1
    for /r "%updates5%\Additional" %%a in (*.*) do set /a e+=1
    for /r "%updates5%\Extra" %%a in (*.*) do set /a f+=1
    if /i !a! gtr 0 DISM /image:g:\mount /Add-Package /PackagePath:%updates5%\Baseline
    if /i !b! gtr 0 DISM /image:g:\mount /Add-Package /PackagePath:%updates5%\General
    if /i !c! gtr 0 DISM /image:g:\mount /Add-Package /PackagePath:%updates5%\Hotfix
    if /i !d! gtr 0 DISM /image:g:\mount /Add-Package /PackagePath:%updates5%\Security
    if /i !e! gtr 0 DISM /image:g:\mount /Add-Package /PackagePath:%updates5%\Additional
    if /i !f! gtr 0 DISM /image:g:\mount /Add-Package /PackagePath:%updates5%\Extra
    )
    echo %%a | find "w81u1x86" 1>nul && (
    set "a=0"&&set "b=0"&&set "c=0"&&set "d=0"&&set "e=0"&&set "f=0"
    for /r "%updates6%\Baseline" %%a in (*.*) do set /a a+=1
    for /r "%updates6%\General" %%a in (*.*) do set /a b+=1
    for /r "%updates6%\Hotfix" %%a in (*.*) do set /a c+=1
    for /r "%updates6%\Security" %%a in (*.*) do set /a d+=1
    for /r "%updates6%\Additional" %%a in (*.*) do set /a e+=1
    for /r "%updates6%\Extra" %%a in (*.*) do set /a f+=1
    if /i !a! gtr 0 DISM /image:g:\mount /Add-Package /PackagePath:%updates6%\Baseline
    if /i !b! gtr 0 DISM /image:g:\mount /Add-Package /PackagePath:%updates6%\General
    if /i !c! gtr 0 DISM /image:g:\mount /Add-Package /PackagePath:%updates6%\Hotfix
    if /i !d! gtr 0 DISM /image:g:\mount /Add-Package /PackagePath:%updates6%\Security
    if /i !e! gtr 0 DISM /image:g:\mount /Add-Package /PackagePath:%updates6%\Additional
    if /i !f! gtr 0 DISM /image:g:\mount /Add-Package /PackagePath:%updates6%\Extra
    )
    DISM /unmount-wim /mountdir:g:\mount /commit
    echo %%a>>%textfile%
    )
    :: merge single WIMs to g:\master\install.wim
    echo.
    echo ===============================================================================
    echo Exporting to g:\master
    echo ===============================================================================
    echo.
    for /f "tokens=* delims= " %%a in (%deltafile%) do (
    echo Exporting %%a to g:\master\install.wim
    echo.
    Dism /Export-Image /SourceImageFile:g:\wim\%%a.wim /SourceIndex:1 /DestinationImageFile:g:\master\install.wim /compress:max /CheckIntegrity
    )
    if exist %wimfile% del /s /q %wimfile% >nul
    if exist %deltafile% del /s /q %deltafile% >nul
    
    :: split master WIM
    echo.
    echo ===============================================================================
    echo Splitting WIM to g:\sources
    echo ===============================================================================
    echo.
    Dism /Split-Image /ImageFile:g:\master\install.wim /SWMFile:g:\sources\install.swm /FileSize:256
    
    :: end procedure
    :: script will pause here
    echo.
    echo ===============================================================================
    echo DONE ...
    echo ===============================================================================
    echo.
    pause
    
    :: EXIT
    endlocal
    exit
     
  11. s1ave77

    s1ave77 Has left at his own request

    Aug 15, 2012
    16,092
    24,400
    340
    #131 s1ave77, Nov 23, 2014
    Last edited by a moderator: Apr 20, 2017
    Check with this:

    Code:
    echo %%a | find "w81u1x64_ThinkPad_Yoga" 1>nul && Dism /Image:"g:\mount" /Add-Driver /Driver:"%driversw81x64%\Lenovo\ThinkPad Yoga" /Recurse /ForceUnsigned
    xcopy %path1%\*.* %target%\*.* /s /d /e /h /r /k /y
    You need to be exact with your variables (without '.' like in the set command), as empty ones can break the script :cool2:..
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  12. s1ave77

    s1ave77 Has left at his own request

    Aug 15, 2012
    16,092
    24,400
    340
    #132 s1ave77, Nov 23, 2014
    Last edited by a moderator: Apr 20, 2017
    Yeah, figured out how to use the more sophisticated Powershell Compare directly in a for loop :cool2:. Tested with a 199 chars filename this time:

    Replace:

    Code:
    for /f "tokens=1 delims= " %%a in ('"powershell Compare-Object -ReferenceObject (Get-Content %textfile%) -DifferenceObject (Get-Content %wimfile%) ^| Format-Table -AutoSize" ^| findstr /i "=^>"') do echo %%a>>%deltafile%
    
    With:

    Code:
    for /f "tokens=* delims= " %%a in ('"powershell Compare-Object -ReferenceObject (Get-Content %textfile%) -DifferenceObject (Get-Content %wimfile%) ^| where-object SideIndicator -eq =^> ^| select -Expand InputObject ^| fl"') do echo %%a>>%deltafile%
    
    Output:

    Code:
    ███████████████████████████████████████████████████████████████████████████████████████
    
    Checking f:\win\wim\exclusions.txt
    against  f:\win\wim\wimlist.txt
    ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
    
    Not in f:\win\wim\exclusions.txt:
    
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX_ABCDE_w81u1x64_XXXX_XXX_XXXXX_XX_X
    XX_XXXX_0001-11-17-2014
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX_ABCDE_w81u1x64_XXXX_XXX_XXXXX_XX_X
    XX_XXXX_0002-11-17-2014
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX_ABCDE_w81u1x64_XXXX_XXX_XXXXX_XX_X
    XX_XXXX_0003-11-17-2014
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX_ABCDE_w81u1x64_XXXX_XXX_XXXXX_XX_X
    XX_XXXX_0004-11-17-2014
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX_ABCDE_w7sp1x64_XXXX_XXX_XXXXX_XX_X
    XX_XXXX_0008-11-17-2014
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX_ABCDE_w7sp1x64_XXXX_XXX_XXXXX_XX_X
    XX_XXXX_0009-11-17-2014
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX_ABCDE_w7sp1x64_XXXX_XXX_XXXXX_XX_X
    XX_XXXX_0010-11-17-2014
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX_ABCDE_w81u1x86_XXXX_XXX_XXXXX_XX_X
    XX_XXXX_0018-11-17-2014
    ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
    
    
    Drücken Sie eine beliebige Taste . . .
    
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  13. hypedave

    hypedave MDL Member

    Oct 14, 2014
    130
    30
    10
    Ok thanks, i'll give this a shot and let you know.
     
  14. hypedave

    hypedave MDL Member

    Oct 14, 2014
    130
    30
    10
    Nope still no go. Skipped right past it.
     
  15. s1ave77

    s1ave77 Has left at his own request

    Aug 15, 2012
    16,092
    24,400
    340
    Assume you mean while trying to add drivers ... :g:. >Check all variables and pathes for being correct.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  16. hypedave

    hypedave MDL Member

    Oct 14, 2014
    130
    30
    10
    #136 hypedave, Nov 23, 2014
    Last edited by a moderator: Apr 20, 2017
    (OP)
    Ok so ran DISM manually to inject the drivers. I'm going to try adjust the code real quick.

    Re worded SetPath variables
    Code:
    [:: Path to Windows 7 x64 Make & Model Driver Store
    set drivers1=d:\drivers\Windows 7 x64
    :: Path to Windows 8 x64 Make & Model Driver Store
    set drivers2=d:\drivers\Windows 8 x64
    :: Path to Windows 8 x86 Make & Model Driver Store
    set drivers3=d:\drivers\Windows 8 x86
    :: Path to Windows 8.1 x64 Make & Model Driver Store
    set drivers4=d:\drivers\Windows 8.1 x64
    :: Path to Windows 8.1 x86 Make & Model Driver Store
    set drivers5=d:\drivers\Windows 8.1 x64/CODE]
    
    Manual DISM code command
    
    
    
    Code:
    Dism /Image:D:\mount /Add-Driver /Driver:"D:\drivers\Windows 8.1 x64\Lenovo\Thinkpad Yoga" /Recurse /ForceUnsigned
    Current Code Used
    Code:
    [echo %%a | find "w81u1x64_Lenovo_ThinkPad_Yoga" 1>nul && Dism /Image:"d:\mount" /Add-Driver /Driver:"%drivers5%\Lenovo\ThinkPad Yoga" /Recurse /ForceUnsigned/CODE]
    
    Adjusted Code (took quotes from d:\mount
    
    
    
    Code:
    echo %%a | find "w81u1x64_Lenovo_ThinkPad_Yoga" 1>nul && Dism /Image:D:\mount /Add-Driver /Driver:"%drivers5%\Lenovo\Thinkpad Yoga" /Recurse /ForceUnsigned
    I'll report back the result. Moved from my Xeon Workstation to my i5 so processing is gonna be a little slower.
     
  17. s1ave77

    s1ave77 Has left at his own request

    Aug 15, 2012
    16,092
    24,400
    340
    #137 s1ave77, Nov 23, 2014
    Last edited by a moderator: Apr 20, 2017
    Code:
    Code:
    NOTE: you did set drivers5=d:\drivers\Windows 8.1 x64 twice  :cool2:.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  18. hypedave

    hypedave MDL Member

    Oct 14, 2014
    130
    30
    10
    Are you sure, where?
     
  19. s1ave77

    s1ave77 Has left at his own request

    Aug 15, 2012
    16,092
    24,400
    340
    #139 s1ave77, Nov 23, 2014
    Last edited by a moderator: Apr 20, 2017
    Code:
    :: Path to Windows 8.1 x64 Make & Model Driver Store
    set drivers4=d:\drivers\Windows 8.1 x64
    :: Path to Windows 8.1 x86 Make & Model Driver Store
    set drivers5=d:\drivers\Windows 8.1 x64

    Make sure you always point to drivers for correct architecture. As your example points w81u1x64 to x86 drivers, when seeing the rem line.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  20. hypedave

    hypedave MDL Member

    Oct 14, 2014
    130
    30
    10
    Good Catch, whats going on here in exceptions.txt? Also files copied to D:\mount are not removed when the image has been unmounted


    Compare-Object : Cannot bind argument to parameter 'ReferenceObject' because it is null.
    At line:1 char:33
    + Compare-Object -ReferenceObject (Get-Content e:\wim\exclusions.txt) -DifferenceO ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidData: :)) [Compare-Object], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.CompareObjectCommand
    ECHO is off.