none
Automate Diskpart.exe to Clean the Partitions RRS feed

  • Question

  • I know diskpart cleans the disk when it partitions right before laying the OS down, but I need to clean the disk much earlier (maybe during the Initialization phase).  I've tried running scripts (VBS, WSF) and even calling the command line (diskpart with a text file) from the task sequence, but everything I've tried fails.  All I want is to run

    diskpart
    select disk 0
    clean
    exit

    Any ideas?

    Michael.

    Sunday, March 9, 2014 3:40 AM

All replies

  • if you want the command to run before the task sequence loads, have you look into running a prestart command? I haven't tried it in MDT standalone but I have tried it with SCCM integration, check out this site:
    http://www.windows-noob.com/forums/index.php?/topic/1995-how-can-i-create-a-boot-image-with-hta-support-using-mdt/

    Sunday, March 9, 2014 4:32 AM
  • I would set this up inside of the unattend file if you need it to run BEFORE the bootstrap menu appears.  To do this, you'll need to edit the unattend that MDT uses when updating the boot devices.  That location is - C:\Program Files\Microsoft Deployment Toolkit\Templates - edit the unattend_pe_x64/x86.xml with whatever you want to have happen.  Here's an example of something I have configured in my winpe.

    <RunSynchronousCommand wcm:action="add">
                        <Order>1</Order>
                        <Description>Add DNS search lists.</Description>
                        <Path>wmic nicconfig call SetDNSSuffixSearchOrder (field.contoso.com,field.contoso.com,contoso.com)</Path>
                    </RunSynchronousCommand>

    For me, this updates search lists so that my machine can find the network path without being joined, and runs before my litetouch.wsf script appears.  Make sure to update your deployment boot images after changing anything in here!  Hope this helps you.

    Ryan


    Monday, March 10, 2014 2:32 PM
  • Not sure why you would need to do this. The only reason I can think of is if the existing partition configuration is blocking deployment somehow, and I've only seen that with 3rd party disk encryption programs.

    Keith Garner - keithga.wordpress.com

    Wednesday, March 12, 2014 11:07 PM
    Moderator