- Is it good? No.
- Is it dynamic? No.
- Does it support settings? No.
- Does it support applications? No.
- Does it have any error handling? Also, no.
- Does it support drivers? Barely.
- But it is fast… 🙂
Before Altiris, BDD, MDT, SMS, PowerShell, and ConfigMgr and other deployment solutions there were batch files…. And many organizations wrote their own little deployment solution using said batch files.
Disclaimer #1: I wrote this post more for fun than anything else, and I definitely recommend using a real deployment solution for your every day deployments. That being said, should you ever want to deploy Windows 10 to a few physical computers, super-fast, for say Windows Autopilot testing. Or should you need to remove any deployment solution out of the picture from your OSD troubleshooting. Yep, this does work. 🙂
Disclaimer #2: You should REALLY not be using this example for any production deployment, but this post is here to highlight, and possibly educate you, of the bare minimum steps needed to deploy Windows 10 over the network.
Still here? Ok then…
Here follows an example of a batch file that deploys a Windows 10 2004 image. You simply run the deploy.cmd batch file from WinPE and walk away. The script assumes you have a file share with the following
- A Windows 10 2004 WIM Image
- A Diskpart.ini script (UEFI example here)
- An Unattend.xml template (Windows 10 x64 example here)
- Some drivers (if needed)
@Echo off Echo Press any key to continue, or press any other key to exit... pause >nul REM Connect to file share Net Use Z: \\MDT03\JurassicDeployment /u:mdt_ba [email protected] REM Create UEFI volumes via diskpart Diskpart /s Z:\diskpart.ini REM Apply the WIM image DISM.exe /Apply-Image /ImageFile:Z:\REFW10-X64-2004.wim /Index:1 /ApplyDir:W: REM Prepare Boot Partition BCDBoot.exe W:\windows /l en-US bcdedit.exe /timeout 0 REM Add drivers md W:\Drivers xcopy Z:\Drivers W:\Drivers /e /i REM Copy and Apply the Unattend.xml md W:\Windows\Panther Copy Z:\Unattend.xml W:\Windows\Panther\Unattend.xml md W:\Scratch dism.exe /Image:W:\ /Apply-Unattend:W:\Windows\Panther\Unattend.xml /ScratchDir:W:\Scratch rd W:\Scratch /s /q rd W:\Drivers /s /q REM Reboot to Windows wpeutil reboot