Share via


DiskPart Automation By Using a Script (Windows Embedded CE 6.0)

1/5/2010

You can automate the DiskPart command prompt utility by using a script file to provide the commands you want.

DiskPart Scripts

To run DiskPart with a script file, add the commands you want to use in a text file. Then, provide this text file to DiskPart by using the -s parameter command at the DOS command prompt. The following example shows you how to provide a text file to DiskPart by using the -s parameter command:

DiskPart -s <myscript.s>

Make sure that you enter Exit as the last command in the script. This enables DiskPart to close after it runs all the commands in the script.

See Also

Concepts

DiskPart Utility
DiskPart Utility Commands