Me gustaria saber como utilizar el disquette formatear saber si esta en el compartimiento utilizar sus archivos conocer sus caracteristicas etc... te lo agradecere bastante, escribeme a [email protected]
Puedes utilizar la API getdrivetype, esto te indica que Drive usas si es 2 removible 3 disco duro 4 remoto 5 CD rom else le indicas no existe unidad. para conocer sus caracteristicas usas el API getdiskfreespace Private Declare Function GetDiskFreeSpace Lib "kernel32" Alias "GetDiskFreeSpaceA" (ByVal lpRootPathName As String, lpSectorsPerCluster As Long, lpBytesPerSector As Long, lpNumberOfFreeClusters As Long, lpTtoalNumberOfClusters As Long) As Long Private Sub Form_Load() Dim Sectors as Long,Bytes as Long,FreeC as Long, TotalC as Long,Total as Long,Freeb as Long GetDiskFreeSpace "A:\", Sectors, Bytes, Freec, Totalc 'Set graphic mode to persistent Me.AutoRedraw = True 'Print the information to the form Me.Print " Path: A:\" Me.Print " Sectores por Cluster:" + Str$(Sector) Me.Print " Bytes per sector:" + Str$(Bytes) Me.Print " Numero de Clusters libres:" + Str$(Freec) Me.Print " Total de Clusters:" + Str$(Totalc) Total = rTotalc& * rSector& * rBytes& Me.Print " númeroTotal of bytes in path:" + Str$(Total) Freeb = rFreec& * rSector& * rBytes& Me.Print " Free bytes:" + Str$(Freeb) End sub para formatear el API Const SHFD_CAPACITY_DEFAULT = 0 ' capacidad del drive por defecto Const SHFD_CAPACITY_360 = 3 ' 360KB, o 5.25" solo drive Const SHFD_CAPACITY_720 = 5 ' 720KB, 3.5" solo drive Const SHFD_FORMAT_QUICK = 0 ' formato rapido Const SHFD_FORMAT_FULL = 1 ' formato completo Const SHFD_FORMAT_SYSONLY = 2 ' copia archivos del sistema Private Declare Function SHFormatDrive Lib "shell32" (ByVal hwndOwner As Long, ByVal iDrive As Long, ByVal iCapacity As Long, ByVal iFormatType As Long) As Long Private Sub Form_Load() 'iDrive = el numero del format. Drive A=0, B=1 C=1 SHFormatDrive Me.hwnd, 0, SHFD_CAPACITY_DEFAULT, SHFD_FORMAT_QUICK End Sub