disk cmd format code example

Example 1: format disk

1. Run Diskpart as administrator.

2. Type the following commands and hit Enter after each command.

list disk
select disk n
# n refers to the disk number of the disk that you need to clean

clean
create partition primary
format fs=ntfs quick
assign drive letter=f
exit

Example 2: cmd prompt format

# EXAMPLE
setx PROMPT ^[[0;33m$P$G$G$S^[[0;32m 'NOTE: ^[ needs to be inserted as one character using ctrl+['


# SYNTAX
# setx PROMPT <your-defined-format>

# Formatting: see https://ss64.com/nt/prompt.html
# Color: see https://stackoverflow.com/questions/2048509/how-to-echo-with-different-colors-in-the-windows-command-line