Skip to content

Instantly share code, notes, and snippets.

@mattronix
Created February 20, 2018 15:05
Show Gist options
  • Save mattronix/41e0b59d5db1e4aa810b2abf4c5934f7 to your computer and use it in GitHub Desktop.
Save mattronix/41e0b59d5db1e4aa810b2abf4c5934f7 to your computer and use it in GitHub Desktop.
@ECHO OFF
:: Jacob Salmela
:: Matthew Frost
:: 2016-03-09
:: Deploy WindowsServer 2016
wpeinit
echo ** Selecting first disk and reformatting...
echo select disk 0 > diskpart%ID%.txt
echo clean >> diskpart%ID%.txt
echo ** Creating system reserved partition...
echo create partition primary size=100 >> diskpart%ID%.txt
echo select partition 1 >> diskpart%ID%.txt
echo active >> diskpart%ID%.txt
echo format quick fs=ntfs >> diskpart%ID%.txt
echo assign letter="r" >> diskpart%ID%.txt
echo ** Creating OS partition...
echo create partition primary >> diskpart%ID%.txt
echo select partition 2 >> diskpart%ID%.txt
echo active >> diskpart%ID%.txt
echo format quick fs=ntfs >> diskpart%ID%.txt
echo assign letter="c" >> diskpart%ID%.txt
echo select partition 1 >> diskpart%ID%.txt
echo active >> diskpart%ID%.txt
echo ** Executing diskpart script...
diskpart /s diskpart%ID%.txt
del diskpart%ID%.txt
echo ** Mounting network share...
net use z: \\deploy.mgmt.lan\images /user:user "password"
echo ** Applying Windows main partition...
Dism /apply-image /imagefile:z:\images\win\server-2016\sources\install.wim /index:4 /ApplyDir:c:\
wpeutil shutdown
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment