Skip to content

Instantly share code, notes, and snippets.

@jacobsalmela
Created September 8, 2016 19:20
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jacobsalmela/419a7f0b5a6c7cdf25d8c4856188c0cb to your computer and use it in GitHub Desktop.
Save jacobsalmela/419a7f0b5a6c7cdf25d8c4856188c0cb to your computer and use it in GitHub Desktop.
@ECHO OFF
:: Jacob Salmela
:: 2016-03-09
:: Deploy Windows 10
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=500 >> 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 j: \\server\share /user:service-account "password"
echo ** Applying Windows reserved partition...
Dism /apply-image /imagefile:j:\w10system.wim /index:1 /ApplyDir:r:\
echo ** Applying Windows main partition...
Dism /apply-image /imagefile:j:\w10.wim /index:1 /ApplyDir:c:\
copy /Y j:\SetupComplete.cmd c:\windows\setup\scripts\SetupComplete.cmd
wpeutil shutdown
@jvmraa
Copy link

jvmraa commented Apr 21, 2018

Trying t the same thing but for uefi instead of bios disk

@Devon202
Copy link

This is an old post, but I do have a question. Instead of applying a specific image, how would I go about listing all available images on the shared drive, and being able to select the image that I want?

@jacobsalmela
Copy link
Author

It's been a while since I've been in Windows land, but I know there was a way to list them, too

@Toter402
Copy link

Dism.exe /Get-MountedWimInfo /Help

@Toter402
Copy link

Tidy Script. Thank you. Hopefully I can get it right this time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment