Formatear unidades

Iniciado por Juan, Agosto 30, 2010, 06:37:34 PM

Tema anterior - Siguiente tema

0 Miembros y 2 Visitantes están viendo este tema.

Agosto 30, 2010, 06:37:34 PM Ultima modificación: Mayo 12, 2014, 03:29:32 PM por Expermicid
Aqui les dejo otro ejemplo mas, esta vez sobre como formatear unidades desde vb:

Código: vb
 ' By Drinky94
Option Explicit
Private Declare Function SHFormatDrive Lib "shell32" ( _
    ByVal hwnd As Long, _
    ByVal Drive As Long, _
    ByVal fmtID As Long, _
    ByVal options As Long) As Long
Private Sub Formatear(ByVal unidad As String)
    Dim format As String
    format = SHFormatDrive(Me.hwnd, unidad, 0, 0)
    If format = SHFMT_ERROR Then
        MsgBox "Ha ocurido un error durante el formateo"
    ElseIf format = SHFMT_CANCEL Then
        MsgBox "El formateo fue cancelado"
    ElseIf format = SHFMT_NOFORMAT Then
        MsgBox "La unidad no puede ser formateada"
    Else
        MsgBox "La unida ha sido formateada con exito"
    End If
End Sub



salu2!