Script Diskpart

This content 6 years old. Please, read this page keeping its age in mind along with the fact technology changes fast and the information on this page me be outdated, not best practice, or plain wrong.

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.


This is the file which contains my diskpart commands.

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


This is the batch file I used.

@echo off
diskpart /s diskprep.txt

Speak Your Mind


This site uses Akismet to reduce spam. Learn how your comment data is processed.