其实就是在无人值守应答文件实现的,这对于一些制作DD包的人比较困惑,
为啥 有的不能自动扩展硬盘,或者在进入系统桌面后才开始自动扩展硬盘。
而我的在你未进入到桌面前就完成了自动扩展硬盘。

还有一个就是其实不用离线挂载注册表修改,或者进入封装模式开启远程桌面,这都可以在无人值守应答文件实现。
下面公布使用方法,在无人值守文件里,编辑添加下面内容:

这个是自动扩展硬盘的。

<component name="Microsoft-Windows-Deployment" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ExtendOSPartition>
<Extend>true</Extend>
</ExtendOSPartition>

这个是开启远程桌面的

<component name="Microsoft-Windows-TerminalServices-LocalSessionManager" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                        <fDenyTSConnections>false</fDenyTSConnections>       
                </component>
                <component name="Microsoft-Windows-TerminalServices-RDP-WinStationExtensions" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                        <UserAuthentication>0</UserAuthentication>
                </component>
                <component name="Networking-MPSSVC-Svc" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                        <FirewallGroups>
                                <FirewallGroup wcm:action="add" wcm:keyValue="RemoteDesktop">
                                        <Active>true</Active>
                                        <Group>@FirewallAPI.dll,-28752</Group>
                                        <Profile>all</Profile>
                                </FirewallGroup>
                        </FirewallGroups>
                </component>