format disk using cmd code example

Example 1: clean pendrive using diskpart

//Windows
1) Open  Start
2) Enter:diskpart
3) Enter:list disk
4) Enter:select disk *number*
5) Enter:clean
6) Enter:lisk disk
7)  Enter:create partition primary
8)  Enter:select partition 1
9)  Enter: active
10) Enter:format FS=NTFS label=Diskname quick //quick is optional if you dont have bad sectors
11) Enter:assign letter=g

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

Tags:

Misc Example