VB Code:
  1. Private Declare Function SHFormatDrive Lib "shell32" (ByVal hwnd As Long, ByVal iDrive As Long, ByVal iCapacity As Long, ByVal iFormatType As Long) As Long
  2.  
  3. Private Sub Form_Load()
  4.  
  5.     ' Drive values A = 0, B = 1, etc
  6.  
  7.     ' To quick format drive with default capacity
  8.  
  9.     ' To Format A drive
  10.    
  11.     SHFormatDrive hWnd, 0, 0, 0
  12.  
  13.     ' To Format B drive
  14.  
  15.     ' SHFormatDrive hWnd, 1, 0, 0
  16.  
  17.     ' To Format C drive
  18.  
  19.     ' SHFormatDrive hWnd, 2, 0, 0
  20.  
  21.     ' and so on.
  22.  
  23.     ' For command line use
  24.  
  25.     ' rundll32.exe shell32.dll,SHFormatDrive
  26.  
  27. End Sub