Re: Unlock the drive
- From: "robertwessel2@xxxxxxxxx" <robertwessel2@xxxxxxxxx>
- Date: Thu, 27 Sep 2007 16:35:30 -0700
On Sep 27, 2:08 am, Sony Kalkan <sonykal...@xxxxxxxxx> wrote:
Hi,
I want to unlock the drive programmatically ? is there an api
function
related to it. For instance, when i run chkdsk with /F parameter, i
get "drive in use" error . I want to unlock drive programmatically
and
execute chkdsk
Well, if you just want to run chkdsk, run it with the /x parameter,
and it will dismount the drive if possible.
Programmatically, you need to open a handle to the volume (CreateFile
with "\\.\D:"), and then send it the FSCTL_DISMOUNT_VOLUME IOCTL with
DeviceIoControl. You must be appropriately authorized to do that, and
you will probably not be able to do it on the boot volume since
Windows will always keep that open.
.
- References:
- Unlock the drive
- From: Sony Kalkan
- Unlock the drive
- Prev by Date: Re: program made in delphi
- Next by Date: Re: Pi program and hard disk usage
- Previous by thread: Unlock the drive
- Next by thread: program made in delphi
- Index(es):
Relevant Pages
|