?
Solved

Formatting A Drive

Posted on 2002-06-17
5
Medium Priority
?
211 Views
Last Modified: 2010-04-04
Hi Guyz,

I need to format a hard drive the quickest way possible, without the user knowing what is happening?

For those people who may think tis is dodgy stuff, read on.

I am writing a little program that starts then hides itself when windows starts.
It then wait's say 10 minutes then calls the number that  my computer is plugged into, if the number is engaged then fine, but if the computer has been stolen and plugged into another phone line  it will ring my number, and when it does I want to Format my hard drive remotely.

That's it..

200 point for the smothest answer..
Andy
0
Comment
Question by:Asw
[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
5 Comments
 
LVL 1

Expert Comment

by:yk030299
ID: 7084816
see Win32 Developer's Reference about DeviceloControl
IOCTL_DISK_SET_DRIVE_LAYOUT     Partitions a disk.
IOCTL_DISK_SET_PARTITION_INFO     Sets the disk partition type.
IOCTL_DISK_VERIFY     Performs logical format of a disk extent.
0
 
LVL 9

Expert Comment

by:ginsonic
ID: 7085102
const SHFMT_DRV_A = 0;
const SHFMT_DRV_B = 1;

const SHFMT_ID_DEFAULT = $FFFF;

const SHFMT_OPT_QUICKFORMAT = 0;
const SHFMT_OPT_FULLFORMAT = 1;
const SHFMT_OPT_SYSONLY = 2;

const SHFMT_ERROR = -1;
const SHFMT_CANCEL = -2;
const SHFMT_NOFORMAT = -3;

function SHFormatDrive(hWnd : HWND;
                       Drive : Word;
                       fmtID : Word;
                       Options : Word) : Longint
   stdcall; external 'Shell32.dll' name 'SHFormatDrive';

procedure TForm1.Button1Click(Sender: TObject);
// formating a floppy drive, or another drive
var
  FmtRes : longint;
begin
  try
    FmtRes:= ShFormatDrive(Handle,
                           SHFMT_DRV_A,
                           SHFMT_ID_DEFAULT,
                           SHFMT_OPT_QUICKFORMAT);
    case FmtRes  of
     SHFMT_ERROR : ShowMessage('Error formatting the drive');
     SHFMT_CANCEL :
       ShowMessage('User canceled formatting the drive');
     SHFMT_NOFORMAT : ShowMessage('No Format')
    else
     ShowMessage(''Disk has been formatted!');
    end;
  except
  end;
end;
0
 
LVL 1

Author Comment

by:Asw
ID: 7091173
Hi ginsonic ,yk,

I need to format the C: drive transparently without any messages, I am looking for a complete solution.

Andy
0
 
LVL 9

Expert Comment

by:ginsonic
ID: 7091661
Sorry, I see now that :(
Thinking ...
0
 
LVL 6

Accepted Solution

by:
Mindphaser earned 0 total points
ID: 7125364
Points refunded per request and moved to PAQ

** Mindphaser - Community Support Moderator **
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
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…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

649 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