Click to See Complete Forum and Search --> : format a disk


visual fzz
November 15th, 1999, 10:11 AM
I want to format a 1.44Mo disk from a VB form.
I wrote a code with the shell function:
Call Shell("c:\winnt\system32\format.com a: /V:vol_32 ", vbNormalFocus)
This method is not very smart and open a MSDOS prompt, which is not so cool in a windows application!!!
Is there an ActiveX which can do that?
How can i launch the format utility of the Explorer from a VB App??
Thanks

Fzz

Lothar Haensler
November 16th, 1999, 02:53 AM
to launch the shell's format function:

option Explicit
private Declare Function SHFormatDrive Lib "shell32.dll" (byval hwnd as Long, _
byval drive as Long, _
byval fmtid as Long, _
byval options as Long) as Long
private Sub Command1_Click()

Dim l as Long
l = SHFormatDrive(me.hwnd, 0, &HFFFF, 0)
End Sub