Script Diskpart

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

Posted by Rich Kreider

Father, geek, caffeine addict, IT guy, photographer and after-hours hacker...

Leave a Reply

Your email address will not be published. Required fields are marked *

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