Show the dialog to format a drive

 



Add 'ShellApi' in the uses of your form

 

Procedure TForm1.Button1Click ( Sender : TObject ) ;

Begin

   ShellExecute ( Application.Handle , Pchar ( 'Open' ) , Pchar ( 'C:\Windows\Rundll32.exe' ) ,

      Pchar ( 'Shell32.dll,SHFormatDrive' ) , Pchar ( 'C:\Windows' ) , SW_SHOWNORMAL ) ;

End ;


Back Home Foward