Windows

Script Diskpart

April 10, 2014 Rich 1 min read

I had 8 thumbdrives I needed to format and set as bootable today.  The nice thing about diskpart command-line utility is that you can put all your diskpart commands in a plain text file and call that file using the /s command-line switch.
Please note: select disk 1 is specific to my environment. Please run diskpart manually and issue list disk to determine which USB drives.

diskprep.txt

This is the file which contains my diskpart commands.

select disk 1
clean
create partition primary
select partition
format fs=ntfs label=BOOT quick
active
assign

PrepDisk.bat

This is the batch file I used.

@echo off
diskpart /s diskprep.txt
pause
exit

Leave a comment