OS Guide: Slipstream Updates Using DISM and OSCDImg

The following is the script used to update the Install.WIM file and create a new .ISO file once the process completes.

An elevated command prompt is required.

To check on the Index ID held in the Install.WIM file:

1
DISM /Get-WimInfo /WimFile:L:\WIMWork\WinServ16WIM\install.wim

Please make sure to copy and paste the script into NotePad and make the necessary changes for the drive letter and folders.

NOTE: The Windows Assessment and Deployment Toolkit (ADK) has OSCDImg.exe. There are two .ISO files that get created. In our case, we create one that has just the bare installer files just like the original Windows Server install .ISO. The second contains a set of folders (_Drivers, _ISOs, _Firmware) that contain extra bits. In our case, the FULL .ISO tops out at 28GB.

ISO File Sizes
ISO File Sizes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
REM **** UPDATE the date in the ISO Name ****
ECHO Freshen Up the WIM File!
XCopy L:\WIMWork\WinServ16BareWIM\install.wim L:\WIMWork\WinServ16WIM /Y

ECHO **** MOUNT INDEX 1 ****
DISM /Mount-Wim /WimFile:L:\WIMWork\WinServ16WIM\install.wim /Index:1 /MountDir:L:\WIMWork\Mount_WinServ
ECHO **** UPDATE INDEX 1 ****
DISM /Image:L:\WIMWork\Mount_WinServ /Add-Package /PackagePath:L:\WIMWork\Updates_WinServ
ECHO **** UNMOUNT INDEX 1 ****
DISM /unmount-Wim /MountDir:L:\WIMWork\Mount_WinServ /commit
ECHO **** FINISH INDEX 1 ****
DISM /Cleanup-Wim

ECHO **** MOUNT INDEX 2 ****
DISM /Mount-Wim /WimFile:L:\WIMWork\WinServ16WIM\install.wim /Index:2 /MountDir:L:\WIMWork\Mount_WinServ
ECHO **** UPDATE INDEX 2 ****
DISM /Image:L:\WIMWork\Mount_WinServ /Add-Package /PackagePath:L:\WIMWork\Updates_WinServ
ECHO **** UNMOUNT INDEX 2 ****
DISM /unmount-Wim /MountDir:L:\WIMWork\Mount_WinServ /commit
ECHO **** FINISH INDEX 2 ****
DISM /Cleanup-Wim

ECHO **** MOUNT INDEX 3 ****
DISM /Mount-Wim /WimFile:L:\WIMWork\WinServ16WIM\install.wim /Index:3 /MountDir:L:\WIMWork\Mount_WinServ
ECHO **** UPDATE INDEX 3 ****
DISM /Image:L:\WIMWork\Mount_WinServ /Add-Package /PackagePath:L:\WIMWork\Updates_WinServ
ECHO **** UNMOUNT INDEX 3 ****
DISM /unmount-Wim /MountDir:L:\WIMWork\Mount_WinServ /commit
ECHO **** FINISH INDEX 3 ****
DISM /Cleanup-Wim

ECHO **** MOUNT INDEX 4 ****
DISM /Mount-Wim /WimFile:L:\WIMWork\WinServ16WIM\install.wim /Index:4 /MountDir:L:\WIMWork\Mount_WinServ
ECHO **** UPDATE INDEX 4 ****
DISM /Image:L:\WIMWork\Mount_WinServ /Add-Package /PackagePath:L:\WIMWork\Updates_WinServ
ECHO **** UNMOUNT INDEX 4 ****
DISM /unmount-Wim /MountDir:L:\WIMWork\Mount_WinServ /commit
ECHO **** FINISH INDEX 4 ****
DISM /Cleanup-Wim

ECHO **** COPY WIM FILES ****
XCopy L:\WIMWork\WinServ16WIM\install.wim L:\USB_Images\_WinServe2016FULL\sources\install.wim /Y
XCopy L:\WIMWork\WinServ16WIM\install.wim L:\USB_Images\_WinServe2016Bare\sources\install.wim /Y
Explorer.exe L:\USB_Images\_WinServe2016FULL\sources\
Explorer.exe L:\USB_Images\_WinServe2016Bare\sources\

ECHO **** CREATE ISO FILE ****
C:
CD \Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\amd64\Oscdimg
Oscdimg.exe -u2 -bL:\USB_Images\_WinServe2016Bare\efi\microsoft\boot\efisys.bin -h L:\USB_Images\_WinServe2016Bare L:\ISOs\WinServ16B-2018-05-30.ISO
XCopy L:\ISOs\WinServ16B-2018-05-30.ISO L:\USB_Images\_WinServe2016FULL\_ISOs /Y
Oscdimg.exe -u2 -bL:\USB_Images\_WinServe2016Bare\efi\microsoft\boot\efisys.bin -h L:\USB_Images\_WinServe2016FULL L:\ISOs\WinServ16F-2018-05-30.ISO
CD \
Explorer.exe L:\ISOs

ECHO **** DONE ****