Often times in a Lite Touch deployment scenario, we want to scrub the primary disk on the endpoint before proceeding with the task sequence.
Assuming there is only one drive on your system (Disk 0), this is one way of achieving this feat:
- Create source folder (UNC accessible) on your distribution point and place two files in it:
- First file we will name “ScrubDisk.cmd”. It has a single line:%systemroot%\system32\diskpart.exe /s %~dp0cleandisk.txt
- Second file will be “cleandisk.txt” and it will contain the following:Select disk 0
Create partition primary align=64
Assign letter c
format FS=NTFS LABEL=”OSDisk” unit=64k QUICK
- Go to your Boot Image of choice, and under Customization tab enable prestart command with command line cmd.exe /c Scrubdisk.cmd and include the source directory created in Step 1.
- Make sure to redistribute the Boot Image for safe measure and any boot media that is based off of this boot image.
- You’re as good as organized!