Tuesday, 30 August 2011

Automatically update MDT boot image in WDS

Are you tired of manually updating the boot image in the WDS server everytime you make some changes to the bootstrap or inject some drivers?

There is a solution. Create a script named UpdateExit.vbs, copy the script code below and paste it in the script you just created.

Option Explicit
Dim oShell, oEnv
Set oShell = CreateObject("WScript.Shell")
Set oEnv = oShell.Environment("PROCESS")
If oEnv("STAGE") = "ISO" then
    Dim sCmd, rc
    sCmd = "WDSUTIL /Replace-Image /Image:""Lite Touch Windows PE (" & oEnv("PLATFORM") & ")"" /ImageType:Boot /Architecture:" & oEnv("PLATFORM") & " /ReplacementImage /ImageFile:""" & oEnv("CONTENT") & "\Sources\Boot.wim"""
    WScript.Echo "About to run command: " & sCmd
    rc = oShell.Run(sCmd, 0, true)
    WScript.Echo "WDSUTIL rc = " & CStr(rc)
    WScript.Quit 1
End if

Place this script in the deployment share's script folder.

Now edit the LiteTouchPE_x86.xml or x64 depending on the boot image you use.

Scroll down to the end of the file and make sure you add the line inside the red rectangle to your fiile. Replace the path to mirror your deployment share.

Now everytime you update your deployment share the boot image in the WDS server will be automatically replaced!

2 comments:

  1. Automatically update MDT boot image in WDS

    Hi guys,

    When i use the scirpt i have this message at the end of the update of the deploymentshare.

    About to run command: WDSUTIL /Replace-Image /Image:"Lite Touch Windows PE (x86)" /ImageType:Boot /Architecture:x86 /ReplacementImage /ImageFile:"C:\Users\tissirm\AppData\Local\Temp\32\MDTUpdate.10468\ISO\Sources\Boot.wim" WDSUTIL rc = -1056702168 Exit code = 1

    Can you help me?

    ReplyDelete
  2. Hi,

    First of all, check if the image has been updated.

    Sometimes this process can throw errors but still update the image.

    The boot images should be under the RemoteInstall folder.

    Otherwise make sure you have followed the steps exactly as they are described.

    Cheers

    ReplyDelete