PowerTip: Use PowerShell to Automate Commands with DiskPart

Summary: Learn how to easily automate commands by using DiskPart.exe.

Hey, Scripting Guy! Question How can I use Windows PowerShell to automatically run DiskPart.exe commands that I use to make bootable keys?

Hey, Scripting Guy! Answer Store the commands you use in DiskPart.exe in a text file (runme.txt in this example), and run them automatically by adding the /s parameter:

DISKPART.EXE /s runme.txt

Note   You must run DiskPart.exe as Administrator.

Comments (1)

Skip to main content