?
Solved

How to Format the A:\ Drive ??

Posted on 1998-09-27
1
Medium Priority
?
133 Views
Last Modified: 2012-05-04
Does any Guru know how to :

1) Check if the A:\ drive is formatted

2) If not formatted, format it

I'm using D2
0
Comment
Question by:joshordan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 10

Accepted Solution

by:
viktornet earned 800 total points
ID: 1340989
Here is some code.......
-----------
   const
           SHFMT_ID_DEFAULT = $FFFF;
           SHFMT_OPT_QUICKFORMAT = $0000;
           SHFMT_OPT_FULL = $0001;
           SHFMT_OPT_SYSONLY = $0002;
           SHFMT_ERROR = $FFFFFFFF;
           SHFMT_CANCEL = $FFFFFFFE;
           SHFMT_NOFORMAT = $FFFFFFFD;

function SHFormatDrive(Handle: HWND; Drive, ID, Options: Word): LongInt;
  stdcall; external 'shell32.dll' name 'SHFormatDrive'

procedure TForm1.btnFormatDiskClick(Sender: TObject);
var
  Code: LongInt;
begin
  Code:= SHFormatDrive(Handle, 0, SHFMT_ID_DEFAULT, SHFMT_OPT_QUICKFORMAT);
  if Code < 0 then
    ShowMessage('Could not format floppy drive');
end;
end.
-----------

Regards,
Viktor Ivanov
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses
Course of the Month8 days, 21 hours left to enroll

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question