Format a Floppy 
Author Message
 Format a Floppy

I would like to write a little VB "applet" that simply launches the GUI you
get when you open up My Computer (NT WS 4.0) and right click on the 31/2
Floppy (A:) icon and select the Format menu item.

Any help would be greatly appreciated.

Thanks!!!!

Mike Zehner



Tue, 12 Sep 2000 03:00:00 GMT  
 Format a Floppy

Mike-
        Try this code. you can also find the same
code on the VBPJ site mistakenly attributed to
someone else.
                                        Joe
http://www.tiac.net/users/lvasseur/SHFormatDrive.html
--
***********************************************************

Microsoft Developer MVP- Visual Basic
Check out Yankee Clipper Plus (April 1998
PCWorld magazine "Best Free Stuff Online")
www.tiac.net/users/lvasseur/ycphome.html
**********************************************************
PS- Please reply to the newsgroup- except in the
case of flames, insults, etc. (Don't bother.)



Quote:
> I would like to write a little VB "applet" that simply launches the GUI
you
> get when you open up My Computer (NT WS 4.0) and right click on the 31/2
> Floppy (A:) icon and select the Format menu item.

> Any help would be greatly appreciated.

> Thanks!!!!

> Mike Zehner




Tue, 12 Sep 2000 03:00:00 GMT  
 Format a Floppy

Joe - Thank you very much,  this was exactly what I was looking for. I
checked out your DiskTool utility.  Do you use SHFileOperation to access
that GUI?  You wouldn't happen to have a snippet of code to share
demonstrating how you did this?

Thanks!!!

Mike

Quote:

>Mike-
> Try this code. you can also find the same
>code on the VBPJ site mistakenly attributed to
>someone else.
> Joe
>http://www.tiac.net/users/lvasseur/SHFormatDrive.html
>--
>***********************************************************

>Microsoft Developer MVP- Visual Basic
>Check out Yankee Clipper Plus (April 1998
>PCWorld magazine "Best Free Stuff Online")
>www.tiac.net/users/lvasseur/ycphome.html
>**********************************************************
>PS- Please reply to the newsgroup- except in the
>case of flames, insults, etc. (Don't bother.)



>> I would like to write a little VB "applet" that simply launches the GUI
>you
>> get when you open up My Computer (NT WS 4.0) and right click on the 31/2
>> Floppy (A:) icon and select the Format menu item.

>> Any help would be greatly appreciated.

>> Thanks!!!!

>> Mike Zehner




Fri, 15 Sep 2000 03:00:00 GMT  
 Format a Floppy

Hi Mike Shell this to Format a floppy:

Declare Function SHFormatDrive Lib "shell32" (ByVal hwndowner As Long, ByVal
idrive As Long, ByVal icapacity As Long, ByVal iformattype As Long) As Long

'' the above function has following Parameters
''hwndowner = Handle of the Form Calling from
''idrive    = Value specifying the zero-based system drive index(A=0,B=1...)
''icapacity = Value specifying the formatted capacity of the drive, this
listying if specified ''comes in combobox of format dialog
''icapacity values = SHFD_CAPACITY_DEFAULT = 0 or SHFD_CAPACITY_360 = 3
''(applies to 360kb 5.25 floppy) or SHFD_CAPACITY_720 = 5 (720kb)
''iformattype = Format type Specification
''iformattype value (forwin95) are : SHFD_FORMAT_QUICK = 0 or
SHFD_FORMAT_FULL ''= 1 or SHFD_FORMAT_SYSONLY = 2 (copies system files only)
''iformattype value (forwinnt) are : SHFD_FORMAT_FULL = 0 (full format) or
''SHFD_FORMAT_QUICK = 1 (quick format)
''return values for Win95
''-3 = failure, drive cant be formatted (drive dosent exist or contains file
used by windows)
''-2 = operation cancelled
''-3 = operation attempted but unsuccessful
''6(?) = operation completed successfully

Public Const SHFD_CAPACITY_DEFAULT = 0

x = SHFormatDrive ( Me.hWnd, 0, 0, 1)
''this will show the format box with the drive A.

hope this helps
All the Best



Sat, 16 Sep 2000 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. formatting a floppy from a QB 7.1 module

2. Format a floppy

3. formatting a floppy

4. Format a floppy

5. How to format a floppy ?

6. How to format a floppy

7. HowTo: Format A Floppy Using VB Code?

8. Format a floppy disk

9. Formatting A Floppy Disk With NT 4 (How)

10. Formatting a floppy from VB

11. Q: Formatting a floppy with VB5

12. Formatting a floppy as a system disk using the windows API

 

 
Powered by phpBB® Forum Software