February 1, 2018 fiducheah

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:

  1.  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
      Clean
      Create partition primary align=64
      Assign letter c
      format FS=NTFS LABEL=”OSDisk” unit=64k QUICK
      Active
      exit
  2. 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.BOOT-Prestart_Command_Disk_Clean
  3. Make sure to redistribute the Boot Image for safe measure and any boot media that is based off of this boot image.
  4. You’re as good as organized!