Help with Win10 Driver injection

  • Moderator

    [moderator note] This thread was moved (poorly by me) from a tutorial to technical help since this post went beyond the scope of the tutorial. Here is the original post by @kyle-heath
    Thanks for all of this…great help while I’m making a windows 10 image. I do have 1 question. When you say this script will not work and you need to add this to the unattend file. Do I need to add




    I’ve added the one 2nd picture to my unattend and I have a script written that copies all of the drivers to a drivers folder on my target machine, but they are not installing during sysprep. Below is the script. If anyone knows how to get the drivers to install after they are moved onto the target machine, I would greatly appreciate it. Thanks!


    [moderate note] Here is my first response to kyle’s question. If I would have forked the topic correctly his post would have been at the top of this thread.

    @kyle.heath First observation is that you are copying the files to c:\windows\drivers. Are the driver files there?

    In the unattend file you are referencing c:\windows\drv for your driver files.

    Which is it? Where is the true location of your driver files?

    With Win10 the OOBE setup does not look at the registry key for the driver path as it did with Win7 (which actually was a hold over from Win XP and not the recommended way of loading drivers. But it was still supported, so we go to what we know).

  • @george1421 what version of MDT are you running btw? I’m on 8450.

  • @george1421 Ok, for some reason when I see the status page that the deployment is complete, it’s not going to the desktop as you stated. It’s rebooting if I put the FINALACTION=REBOOT or if it’s blank, it reboots. If it’s on SHUTDOWN, it shuts down.

  • @george1421 I’ll try when I get home in a few. When I closed the display page trying to do this, the VM shuts down, but I’ll try again, think I’m missing something. I’ll let you know.

  • Moderator

    @Jamaal See this is where I’m confused. The status page should be displayed in an active windows admin login. When you close the status page for MDT you should be “in windows”. At this point when you close the status page MDT is done. Just open a command prompt and run your script.

    In my case I navigate to where the script is using windows explorer, right click on the sysprepper.cmd file and run as administrator (because of UAC). sysprep is run and the computer is powered off.

  • @george1421 Ok, that’s where I’m getting stuck at. So I took your recommendation to change the skip summary to no so I get the dialogue box, but how do I get to the Windows logon console? I can do for example f8 to get the command prompt, but I want to get a Windows console to run the final script like your setup for example.

    My bad I didn’t write all the info.

  • Moderator

    @Jamaal said in Help with Win10 Driver injection:

    Well I just want to have MDT 2013 to be at a state for me to run final scripts so I can run my own
    sysprep and copy the unattend.xml to the panther directory

    This is what I don’t understand. My workflow is that once the mdt status page is displayed then MDT is done. It leaves me at a logged in windows console. I just navigate to where my sysprepper.cmd script is and I run it. I don’t have to do anything post MDT status page other than run my script. I’m not sure what you are doing with the auto admin login stuff. So as I said I’m not sure what your goal is.

    The tail end of my state restore step in the deployment sequence looks like this:

  • @george1421 Well I just want to have MDT 2013 to be at a state for me to run final scripts so I can run my own
    sysprep and copy the unattend.xml to the panther directory. Now I was following this from Johan putting this as the final task and it’s not running in Winpe mode.

  • Moderator

    @Jamaal I don’t totally understand your situation. I know unexpected reboots WILL cause MDT to consider the build invalid.

    What is your end goal here? What script / action are you doing at the end of your task sequence to break MDT system build? There may be another way to go about it.

  • @george1421

    Can you please tell me how you get to run a script after deployment without rebooting and triggering the dirty environment in MDT 2013? I tried following this post from deployment research, but no matter what I try, it won’t go back into Windows, stays in Winpe and I get the dirty environment message:

    I just want to do final touches without having to rerun syysprep, know what I mean?

  • @george1421

    I just want to see what’s easier to maintain, ex fog client vs using sed command. Where it says computer name, do I replace it with a computer name I want to start? Ex NY-WB- is what I would like to start as a prefix

  • @george1421

    George, I’m 90% good with deployment. I was able to get a working script to deploy the Lenovo drivers. I saw how to use deploy bug to see where it was failing.I ended up using an older script you put. So here’s my issues.

    • I used the fog client and joined the domain successfully, this is windows 10 build 1709. I saw last min where you said to add the pinstall command in the setup complete.exe to install the drivers. How do I use the sed command to copy another setupcomplete.cmd from the fog server instead of reimagining? I looked at some examples, wanted to test using the sed command to copy the updated unattend.xml and setupcomplete.exe, but not sure where to put it in for example, file. I get syntax errors.

  • @george1421 ok, now I understand. I just made that change. I had it set on no because I was following deployment research website. I’m going to try that approach. I’ll post up some updates when I get everything accomplished. Thanks again for guiding me through this.

  • Moderator

    @Jamaal said in Help with Win10 Driver injection:


    If you set the above step to NO, then at the end of the MDT process you will get a status message if your MDT deployment was successful or not. I would enable that to ensure everything deployed correctly, this may be important to know.

    I can only tell you how I use MDT and FOG. After the final status is displayed then the MDT lite touch process is done for me. If I need to make any final system adjustments or add applications that might need to be added, but don’t support unattended installs I would do it at this point. When I feel the system is ready for FOG capture (still without rebooting after MDT), I go to the location where my MDT copy files task sequence is location and run the DoSysPrep.cmd batch file. That batch file copies my custom unattend.xml file to the panther directory, moves setupcomplete.cmd to its location, copies a few other ini files to their proper location and then calls sysprep.exe with the proper commands to run sysprep and power off the system. Then I capture with FOG.

    The pause in the process between the end of MDT and start of DoSysPrep.cmd gives me a chance to make any final adjustments to the system as well as take a virtual machine snapshot of the system before running sysprep. That way if I need to fix something discovered after FOG deployment, i can just restore the VM to the point before sysprep, fix the issue and then run the DoSysPrep.cmd batch file again and recapture with FOG. I don’t need to take the time to rebuild using MDT since I have a snapshot of the system before sysprep. That is my workflow.

  • @george1421 I’m a little confused, sorry. Should I remove the task from MDT to not sysprep the machine and run a custom script to sysprep & use a custom unattend.xml? I have these in the bottom of my rules page, not sure where to see the closing status message.


  • Moderator

    @Jamaal When I create my golden image, I let MDT build it and then after the closing status message, I immediate go to my scripts directory on the target computer and run the sysprep script I copied over using an MDT task sequence. I don’t normally reboot the golden image before sysprep and FOG capture. I NEVER sysprep an image more than once. If I need to do that I will fix what ever reason and then reimage with MDT.

  • @george1421 or should I let the VM boot after MDT deployment, create a cmd script to sysprep again and also point the setupcomplete.cmd and unattended.xml to their correct spots?

  • @george1421 George, I started playing around with the copy script and worked good copying to the Windows 10 client, but I didn’t do fog as yet. I just booted the VM after MDT to test it out and got through setupcomplete.cmd to copy over, but looks like the unattend.xml didn’t make the changes. Any ideas? I didn’t see the c:\drivers folder create even though I used WSIM to add the line? Do I need to call the command to create the folder drivers as well?

  • @george1421 hey George, so I see what the problem was with WSUS. I thought the content folder can be put anywhere since it said remote path. I tried my NAS both network path and iscsi, but still locks up the downloads. I did research and said it’s not supported in a network share, so I put it back on the local.

    Now for the Office 2013 updates, I found this online to extract the service pack 1 and I was able to get the updates faster compared to WSUS.

    I’m working on the unattend file and will work on copying files this weekend. The offline script I was following sucked and didn’t work no matter what I tried. I’ll keep you posted. Thanks for leading me in the right direction.

  • Moderator

    @Jamaal The c:\windows\panther folder is the first place OOBE looks for the unattend.xml file. You really can place it anywhere if you call out the specific directory when you run sysprep. But I’ve never been one to push luck. I place the file in the Panther directory and call out the specific path when sysprep is run.

    As for how wsus is setup for win10, I’d have to look at the wsus server for that.