Thursday, 9 February 2017

If using SysPrep and DISM\IMAGEX to deploy Windows, watch out for this trap!

If you boot to Windows PE and use some sort of script to install Windows OS's to systems using ImageX or DISM, you should check your NTFS Junction points!

So after you have deployed the image and it is booting to Windows nicely, simply drop to an Admin command shell and type  dir /aL

Check your Junctions!

You should see that the Junctions and Symlinks all point to the Windows drive.

If they do not, then you may get some weird problems when installing or running some programs, or with some internal Windows functions.


Typically, this problem is caused by DISM\ImageX and the way it treats reparse points.

If you apply an image to a hard disk volume which does not have the drive letter of C: (e.g. the target volume is U: at the time you are Applying the image using DISM\ImageX), then DISM\ImageX will set all the reparse points to point to U: for you!

The way to avoid this issue, is to use the /norpfix switch.
Another way is to ensure that the target drive letter when using DISM /Apply-Image is always C: (or whatever the drive letter will be when it boots to Windows).

For more information on reparse points see here.
For information on ImageX /norpfix see here.
For information of DISM /NoRpFix see here.

Note that you can both capture using /norpfix and/or apply using /norpfix depending on your requirements.

So go check your imaged systems now!