Adding date to the captured WIM File in MDT

When using the build and capture task sequence in MDT Lite Touch it make perfect sense to add date information to the WIM file name created. Since CustomSettings.ini understands inline VBScript you can simply set the following:

Update May 30, 2018: Formatted the code to use two digits in month and day.

BackupFile=%TaskSequenceID%_#year(date) & "-" & Right(String(2, "0") & Month(date), 2) & "-" & Right(String(2, "0") & Day(date), 2)#.wim

Note: Make sure you don't have " (curly quotes) in the .ini file but instead use " (straight quotes)

Sample

Below is the output from simulating (in PowerShell) a sample CustomSettings.ini file.

[Settings]
Priority=Init, Default

[Init]
TaskSequenceID=REFW10-X64-001

[Default]
BackupFile=%TaskSequenceID%_#year(date) & "-" & Right(String(2, "0") & Month(date), 2) & "-" & Right(String(2, "0") & Day(date), 2)#.wim
image
The WIM file name in the ZTIGather.log file.

Happy Deployment, Johan

About the author

Johan Arwidmark

5 1 vote
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments

>