Update 8.22.2016 – Update for 1607 Media (Build 14393), found that using the 1511 DaRT didn’t play so nice on a 1607 install of Windows 10.
Fix, Create new DaRT WIM with latest ADK.
Changes to Made for 1607
- Uninstall old ADK, Install new ADK
- Run the DaRT Recovery Image creator to create new WIM using new ADK
- NO Longer need to run the HotFix!
- Change WinRE partition size from 900 to 1100 – Found 900 would cause issues from time to time.
- Updated Script to include F4 Support & add Timeout to help with DiskPart sporadic issues. (Download HERE)
- Thanks to Alex Nicastro for the Assist on that.
- Basically, just follow the instructions below using the updated ADK, skip the HotFix, and name your package accordingly.
Requirements:
- Windows 10 ADK (Build 10586) – Download HERE
- Windows 10 ADK Hotfix to fix issue in ADK– Download HERE (We’ll get to this later)
- DaRT Recovery Image Installed –> Part of MDOP
- Windows 10 Media (Build 10586) Mounted
Setup:
Launch the MS DaRT Recovery Image Wizard – If you see this error, it’s because of your Powershell group policy, to get around this, open elevated command prompt and do this:
Reg delete HKLM\SOFTWARE\Policies\Microsoft\Windows\Powershell /v ExecutionPolicy /f
– Now try again
Choose 64-bit Dart Image – I’ve mounted the Windows 10 ISO to the D: drive
You can leave the tools to default
Check the box “Allow…” and let it default to 3388
Advanced Options, add any Storage & NIC drivers you’ll need & any WinPE addons
Create Image: Select Create WIM, set the path to c:\cabs
– Note, if you want, at this step, you can check the box “Edit image” and then after it a short period, you’ll get the opportunity to add files. I did this to add cmtrace and some other tools into the image
Now wait for a few minutes while it is generated
Adding HotFix to boot.wim (Only if you’re using Windows 10 1511 build 10586)
Extract the HotFix to c:\Cabs (I’m using 7zip)
It will create 2 schema files.
Also create the folder mount (C:\Cabs\Mount)
Make sure your boot.wim file is save to C:\Cabs\DaRT10\x64\boot.wim, you’ll then need to run these commands: ( original documentation here: https://support.microsoft.com/en-us/kb/3143760), this is modified based on where I’ve saved the files in my example.
Run from elevated “Deployment and Imaging Tools Environment”
- dism /mount-wim /wimfile:C:\Cabs\DaRT10\x64\boot.wim /index:1 /mountdir:C:\Cabs\mount
- icacls C:\Cabs\mount\Windows\System32\schema.dat /save “%temp%\AclFile”
- takeown /F C:\Cabs\mount\Windows\System32\schema.dat /A
- icacls C:\Cabs\mount\Windows\System32\schema.dat /grant BUILTIN\Administrators:(F)
- xcopy “C:\Cabs\schema-x64.dat” C:\Cabs\mount\Windows\System32\schema.dat /Y
- icacls C:\Cabs\mount\Windows\System32\schema.dat /setowner “NT SERVICE\TrustedInstaller”
- icacls C:\Cabs\mount\Windows\System32\ /restore “%temp%\AclFile”
- dism /unmount-wim /mountdir:C:\Cabs\mount /Commit
Ok, now we have our boot.wim file, it’s time to get it into the OSD process.
In the Standard ConfigMgr MDT Task Sequence, go to the Format and Partition Disk (UEFI)
Change the Windows RE Tools name to WinRE and change the size from 300 to 900 1100
Create a Package with your boot.wim file and three batch files: (Download here)
SetDriveLetterLabel.cmd (This will take the Partition Labeled WinRE and assign letter R)
——-
REM ======start batch script=======
@echo off
setlocal ENABLEDELAYEDEXPANSION
:: Full path to diskpart.exe. Defaults are:
:: Windows 2000: “C:\Program Files\Resource Kit\diskpart.exe”
:: 2003/XP: “C:\windows\system32\diskpart.exe”
set dp=c:\windows\system32\diskpart.exe
:: Volume label
set label=WinRE
:: Temporary command file for diskpart.exe
set dps=”%TEMP%\dp.txt”
echo list volume>%dps%
echo exit>>%dps%
set label_short=%LABEL:~0,11%
if exist %dp% (
for /f “delims=” %%i in (‘%dp% /s %dps%’) do (
set string=%%i
if not “!string:%label_short%=!”==”!string!” (
set volnum=!string:~9,3!
set volnum=!volnum: =!
)
)
if not “!volnum!”==”” (
echo Volume Label: %label%
echo Volume Number: !volnum!
echo select volume !volnum! >>%TEMP%\assignr.txt
echo assign letter=R >>%TEMP%\assignr.txt
%dp% /s %TEMP%\assignr.txt
) else (
echo Cannot find volume with label %label%
)
) else (
echo Cannot find %dp%&goto :EOF
)
REM =======end batch script========
——-
RemoveDriveLetterLabel.cmd (This will remove the drive Letters D/E/R). I was having some computers add a D or E drive based on other factors, so I just added it to this script to remove those letters too.
———
REM ======start batch script=======
@echo off
setlocal ENABLEDELAYEDEXPANSION
:: Full path to diskpart.exe. Defaults are:
:: Windows 2000: “C:\Program Files\Resource Kit\diskpart.exe”
:: 2003/XP: “C:\windows\system32\diskpart.exe”
set dp=c:\windows\system32\diskpart.exe
:: Volume label
set label=WinRE
:: Temporary command file for diskpart.exe
set dps=”%TEMP%\dp.txt”
echo list volume>%dps%
echo exit>>%dps%
set label_short=%LABEL:~0,11%
if exist %dp% (
for /f “delims=” %%i in (‘%dp% /s %dps%’) do (
set string=%%i
if not “!string:%label_short%=!”==”!string!” (
set volnum=!string:~9,3!
set volnum=!volnum: =!
)
)
if not “!volnum!”==”” (
echo Volume Label: %label%
echo Volume Number: !volnum!
echo select volume !volnum! >>%TEMP%\remover.txt
echo remove letter=r >>%TEMP%\remover.txt
echo select volume !volnum! >>%TEMP%\removed.txt
echo remove letter=d >>%TEMP%\removed.txt
echo select volume !volnum! >>%TEMP%\removee.txt
echo remove letter=e >>%TEMP%\removee.txt
%dp% /s %TEMP%\remover.txt
%dp% /s %TEMP%\removed.txt
%dp% /s %TEMP%\removee.txt
) else (
echo Cannot find volume with label %label%
)
) else (
echo Cannot find %dp%&goto :EOF
)
REM =======end batch script========
——-
InstallDartUEFI.cmd (This deletes the old Windows Recovery WIM, creates the new folder structure and copies the boot.wim into place and assigns it as the recovery wim – It calls the script above to remove the drive letter when it’s done.)
Update 7/22/16 – Added 2 lines in RED, I was finding that on some systems, it wasn’t copying my custom WIM over because there wasn’t enough room on the Partition because of the Default WIM. Add line to Delete the Default before coping the Custom one over. – I have not updated the scripts in the ZIP File yet. Still doing more testing, as I’m having issues getting this working properly on HyperV, but so far all of my Physical Machines are working properly.
Update 8/22/16 – Added Line for F4 & Timeout
——–
REM SetDriveLetterLabel.cmd – Now doing in Previous Step, sets WinRE partition to Letter R
REM Make Directory where DaRT Recovery WIM will be placed
mkdir R:\Recovery\WinREREM Delete old WindowsRE Folder (Free up room to copy in new WIM)
rmdir R:\Recovery\WindowsRE /S /QREM Copy DaRT Recovery WIM into Recovery Partition
copy boot.wim R:\Recovery\WinRE\winre.wimREM Set Windows to use the new DaRT Recovery WIM
C:\Windows\System32\ReAgentc.exe /disable
C:\Windows\System32\ReAgentc.exe /setreimage /path R:\Recovery\WinRE /target C:\Windows
C:\Windows\System32\ReAgentc.exe /setreimage /path R:\Recovery\WinRE /target C:\Windows /bootkey 3e00
C:\Windows\System32\ReAgentc.exe /enableREM Add timeout
timeout /t 15REM Remove the Drive Letter for the Recovery Partition – Removes Letter R and D/E if exist.
RemoveDriveLetterLabel.cmd
——-
In the TS:
In the State Restore Group, add two Steps
- Install WinRE – Dart10 – UEFI – Step1 (cmd /c SetDriveLetterLabel.cmd)
- Install WinRE – Dart10 – UEFI – Step2 (cmd /c InstallDartUEFI.cmd)
After OSD, you can go into your recovery options.. and choose Advanced Startup – Once at the Option Screen, pick Troubleshoot –> Advanced –> Command Prompt
It will now reboot into the Windows Recovery Partition.
You’ll see a prompt for “Would you like to initialize network connectivity..”, click yes
It will now prompt you for your bitlocker Key, if bitlocker is enabled. Enter it and click continue
The Command Prompt will Open, just go ahead and close it.
You will now see options, choose Troubleshoot –> Microsoft Diagnostics and Recovery Toolset will be an option.
Now that you launched DaRT, you’ll have several options available to you, including Remote Connection, which is what I’m using to connect in to grab the screen capture.
Several hand tools built in like LockSmith, to recover Admin Passwords. This is handy if you have LAPS implemented, and the machine is deleted from the domain so you no longer have access to the Admin password.
And if you like, you can even add a web browser to your Image, because hey, why not! Pale Moon 64bit seems to work alright. Just Extract the Program to a folder and copy that folder into your image. Then use Explorer to browse to it.
So there you have it, integrating DaRT 10 into your Windows 10 10586 Deployments
I’ve tested this on Dell Latitude E6540, Precision 7510 & MS Surface Pro. I’ve done this in the Past with DaRT 8 on an entire range of Dell devices without any issues. But I’ve only started to implement this with DaRT10.
I appreciate that article. Is it possible to create a hardware bootkey using the reagentc.exe commands, so a user could boot directly to the recovery environment prior to booting into windows? If it is possible how would one go about doing it? I have tried using the following command:
C:\Windows\System32\ReAgentc.exe /setreimage /path R:\Recovery\WinRE /target C:\Windows /bootkey 0x3d00
that should have allowed to press the F3 key and the PC would boot in the winre.wim, but it does not.
That is a great question, I have actually not thought of doing that, but I like what you’re thinking. If I get time to mess with this and figure it out, I’ll let you know.
Great post , I have tried the above but I am not seeing the results as expected .in the SMTS.log file I am seeing the following errors:
C:\_SMSTaskSequence\Packages\NY100019>C:\Windows\System32\ReAgentc.exe /disable InstallSoftware 01/06/2016 04:49:18 3824 (0x0EF0)
The system cannot find the drive specified. InstallSoftware 01/06/2016 04:49:18 3824 (0x0EF0)
The system cannot find the drive specified. InstallSoftware 01/06/2016 04:49:18 3824 (0x0EF0)
InstallSoftware 01/06/2016 04:49:19 3824 (0x0EF0)
C:\_SMSTaskSequence\Packages\NY100019>C:\Windows\System32\ReAgentc.exe /setreimage /path R:\Recovery\WinRE /target C:\Windows InstallSoftware 01/06/2016 04:49:19 3824 (0x0EF0)
REAGENTC.EXE: Operation Successful. InstallSoftware 01/06/2016 04:49:19 3824 (0x0EF0)
InstallSoftware 01/06/2016 04:49:19 3824 (0x0EF0)
InstallSoftware 01/06/2016 04:49:20 3824 (0x0EF0)
C:\_SMSTaskSequence\Packages\NY100019>C:\Windows\System32\ReAgentc.exe /enable InstallSoftware 01/06/2016 04:49:20 3824 (0x0EF0)
REAGENTC.EXE: The specified path was not found. InstallSoftware 01/06/2016 04:49:20 3824 (0x0EF0)
InstallSoftware 01/06/2016 04:49:20 3824 (0x0EF0)
InstallSoftware 01/06/2016 04:49:39 3824 (0x0EF0)
C:\_SMSTaskSequence\Packages\NY100019>REM Remove the Drive Letter for the Recovery Partition – Removes Letter R and D/E if exist. InstallSoftware 01/06/2016 04:49:39 3824 (0x0EF0)
InstallSoftware 01/06/2016 04:49:39 3824 (0x0EF0)
C:\_SMSTaskSequence\Packages\NY100019>RemoveDriveLetterLabel.cmd InstallSoftware 01/06/2016 04:49:39 3824 (0x0EF0)
If you hit F8, and check the command prompt, is your OS installed to the C:\ at that point? What happens if you pause your TS and run it manually, same errors?
I am testing this on a vm guest machine to prove the concept first, this machine is also a gen1 vm in hyper v is that likely to have a bearing and also what if the machine does not have uefi?
If it isn’t UEFI, it can still work, but I haven’t tested recently. I used to do it with non-UEFI devices. I believe as long as you make a Partition with the Label WinPE, it will work.
I can see a hidden partition on the machine through diskpart but do not get the recovery options as per steps at the end:
You will now see options, choose Troubleshoot –> Microsoft Diagnostics and Recovery Toolset will be an option.
I do not see MSDART Toolset as an option in troubleshooting, would welcome a dialog via PM if possible?
Hello,
I have the same issue, it goes through I see the hidden partition. I noticed theres 488Mb used, but when i got Troubleshoot ->Microsoft Diagnostics and Recovery Toolset is not there… Do you know where i can get a full install guide..
Thanks,
Alex
So you go to troubleshooting, choose advanced, choose”Command Prompt”, then it reboots into your Recovery Environment, and at that point you don’t see the DaRTt Tools? I don’t see the DaRT recovery tools until after the reboot.
I’ve noticed on a couple of my models that when I reboot after choosing Command Prompt, that when it reboots, it says it can’t find an administrator account on the PC. Still trying to troubleshoot that issue. (Added one line into the script to see if it helps, updated article to show) Happens on my Virtual Machines and my Venue tablets. However, the DaRT Tools did work on my new 5175 & 7275 Tablet models without any modifications.
Also added
Hello,
I go into troubleshooting only see Microsoft restore points. I had it working in my Qa environment. I couldn’t login so I had to use locksmith to change the admin password. I thought it was my reference image so I changed my reference image now I can login but don’t see the DaRT tools. Monday I’ll be placing a call to MS to see what I did. I noticed it still creates the windowsre partition even though I remove it and it won’t let me see what’s in it. Im stuck at this point :(…
Thanks,
Alex
Hello,
When I go to troubleshooting, choose advanced, choose”Command Prompt”, Says “Preparing Command Prompt, I choose “Administator”, Put password, Then a command prompt window appears. I delete my whole environment and started over from scratch.
Thanks,
Alex
Once you close out of Command prompt, it should bring you back to the Troubleshooting Menu, at that point you should see DaRT as an option.
Hey,
Thanks so much for the quick responses!.. You were right after closing the command prompt I did see the DaRT recovery. The only problem I have is that when the user clicks on the command prompt they will need to type in the local admin password. Is there a way around that?
Thanks.
Alex
Hello,
Just a quick update so I was able to create a hotkey using the following line:
C:\Windows\System32\ReAgentc.exe /setreimage /path R:\Recovery\WinRE /target C:\Windows /bootkey 3ed00.
After doing that now you can press F4 and get into DaRT tools without going through the command prompt closing the window. Then clicking on Troubleshooting, I appreciate all your help with this :).
Thanks,
Alex Nicastro
Hello,
With the release of Windows 10 1607, will we still have to add the schemas from KB3143760 to the wim file? After making a new Windows image with 1607, the DaRT recovery option is missing – even after selecting the Command Prompt option from the menu.
Thanks,
Paul
Hey Paul, I haven’t yet done much with 1607. I haven’t rebuilt the DaRT WIM yet using the updated ADK, but I’m quite sure you’re right, you would NOT need to add the schemas after, which will save a lot of time. I’ve replaced the Windows 10 1511 WIM with a 1607 WIM in my TS, but left everything else alone (Inlcuding my DaRT image, which is still 1511), and even though the Computers is now 1607, it still gives me the ability to use DaRT when I go into Recovery.
**Fixed Typo in previous post**
Hello,
I am sorry for the typo but I made the following changes in the “InstalldartUEFI.cmd” file:
C:\Windows\System32\ReAgentc.exe /setreimage /path R:\Recovery\WinRE /target C:\Windows /bootkey 3e00
This will set the F4 key to boot to DaRT. Here are the scan codes for the various function keys.
Key Scan code
F1 0x3b00
F2 0x3c00
F3 0x3d00
F4 0x3e00
F5 Do not use (reserved)
F6 0x4000
F7 0x4100
F8 Do not use (reserved)
F9 0x4300
F10 0x4400
F11 0x8500
F12 0x8600
Thanks,
Alex Nicastro
Hi there, If I rename the WinRE partition and make it 1100MB, will Bitlocker/MBAM still be able to utilize this partition as well? Or will I need to make a separate Recovery partition for MBAM/Bitlocker as well?
You are correct, Bitlocker will use the WinRE partition. When running UEFI, you need 4 Partitions. WinRE, EFI, MSR, OSDisk. See more info here: https://technet.microsoft.com/en-us/library/hh824839.aspx
gwblok, I know this question is not entirely related to the above post, I download the MDOP .iso from MSDN to make the DaRt Tools. After extracting, run the MSDaRT100.msi, but when i go to the dart directory, their is no dart 10 setup wizard. i also own MDOP 2012 had no issues, wizard loaded . Also my ISO is MDOP 2015. so could you please help, just need to know how to get to the Wizard to build my tools. Thank You for your support.
P.S. I did grab your script Nice work.
Just remember to have the Windows ADK installed first, or it will not give the option to create the ISO.
Any Idea on a net new installation I would get this.
Generating DaRT image
Installing and configuring DaRT tools…
The running command stopped because the preference variable “ErrorActionPreference” or common parameter is set to Stop: Error applying Dart Tools to the image mounted to: ‘C:\Users\USERNAME\AppData\Local\Temp\DaRT_Mount_2017.01.12.10.46.43’. Package is not applicable: ‘C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-FMAPI.cab’..
Cleaning up temporary files
Temporary folder: C:\Users\USERNAME\AppData\Local\Temp\DaRT_Mount_2017.01.12.10.46.43
The only thing I can think of would be permissions. I’d suggest doing this on a Clean VM, where you’re logged in as admin, and you launch the process elevated.
Any one have the issue when you boot into your windows 10 recovery partition and try to open a command window it says “You need to sign in as an administrator to continue, but there aren’t any administrator accounts on this PC”
There is an administrator account (2 of them) but it wont list them.
Looks like this was a problem with windows 8.1 and server 2012 WinRE
If you have this set:
You enable the Accounts: Block Microsoft accounts Group Policy and select the Users can’t add or log on with Microsoft accounts option in the following Group Policy path:
Computer Configuration\Windows Settings\Security Settings\Local Policies\Security Options
Which we do. I cant find a fix for Dart 10
https://support.microsoft.com/en-us/help/2957212/-no-administrator-accounts-error-when-you-select-an-option-in-winre-in-windows-8.1-or-windows-server-2012-r2
Gary, thank you for this post. I did something similar for my Win7 deployment (not using your script) but I am currently testing your method against my Win10 1607 build. One of the requirements we have is that all our laptops are encrypted with Bitlocker, so in my ConfigMgr MDT task sequence, I preprovision bitlocker to get the disk encrypted. Unfortunately, I have found that I am unable to get a custom dart wim into the recovery partition working on laptops; desktops and my vm test environment are successful. Have you run into that issue or have any insight how I can go about getting around that issue? Appreciate any feedback.
It’s been working for me on 1607 no problems. I do NOT preprovision bitlocker. I set bitlocker near the end of the TS. On a test machine, if you don’t enable Bitlocker via preprovision , does it work?
It’s Working for me With Pre-Provisioning but I use MBAM.
I Have a Question. How it the F4 fonciton suppose to Work ?
More precisely when do I use it. When I go to Windows Advance Startup while its rebooting the F4 key doesn’t seems to do anything.
Beside that all is fine. Great Work on that.
Hey Max – did you do anything specific to get this to work with Pre-Provisioning?
I”ve been failing miserably getting this to work. I eliminated it from the task sequences so now I’m trying to get it to work.
When I try to enable using reagentc /enable I get the following error:
REAGENTC.EXE: Windows RE cannot be enabled on a volume with Bitlocker Drive Encryption enabled.
There is a way to add the DaRT button instead of using the Command Prompt. Put next text in notepad and save in UTF-8 with name MSDaRT.xml, run the command – ReAgentc /setbootshelllink /configfile MSDaRT.xml.
Microsoft® Diagnostics and Recovery Toolset
Launch various DaRT recovery tools
Hi Gary
i am applying the same but cannot boot into or see any dart options ….i have created a boot.wim and the same TS but when i boot into recovery advanced startup, i see nothing apart from standard options ….and no dart options…..according to this method only boot.wim is being copied into the recovery partition…..am i missing some files for it to boot into DART as recovery image
I honestly stopped bothering doing this. With Windows 10 updating so often and WinRE being replaced each upgrade, it wasn’t worth my time to integrate DaRT. For now, we just have a DaRT flash Drive if needed.
Hello I tested this using a VMWARE VM looks like it wants to work i get “Would you like to initialize network connectivity..”, I click yes but then reboots
any Ideas
Thanks
Sorry, I do not use VMWare, and I haven’t touched DaRT in quite awhile.
I got this work following the instructions. Great write up. Only thing, and it maybe my dense head lol, is the F4 usage. I am a little fuzzy where is this used. Is this supposed to trigger the machine to go into the recovery mode as it is booting up when F4 is pressed?