Page 1 of 1

Formating usb

Posted: Tue Jan 01, 2013 12:23 am
by jtlusco
I am trying to add the ability to format a usb on button click i have it so when it loads it detects the usb and lists them for you to pick through now i need it to take the drive letter that you pick in the combobox and format it in fat 32 then set it as active then copy files to the drive any help on this would be great

thanks in advance

Re: Formating usb

Posted: Tue Jan 01, 2013 1:54 am
by smashapps
There is a simple way of formatting Removable drives but that's for FAT 16.

You might want to look into SHFormat. However it is fairly old and poorly documented. I can't help any more than that but good luck.

Re: Formating usb

Posted: Tue Jan 01, 2013 2:13 am
by Shim
this is used to get available drivers in combo
Code: Select all


Imports Microsoft.Win32
Imports System.IO
Public Class form1
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        For Each drive In Environment.GetLogicalDrives
            Dim InfoDrive As DriveInfo = New DriveInfo(drive)

            If InfoDrive.DriveType = DriveType.Removable Or InfoDrive.DriveType = DriveType.Fixed Then

                ComboBox1.Items.Add(drive)
            End If
        Next
    End Sub
End Class



you can format with WMI http://technet.microsoft.com/en-us/libr ... 56569.aspx

Re: Formating usb

Posted: Wed Jan 02, 2013 2:55 am
by mandai
It is possible to open the shell format window with the SHFormatDrive function.

This thread might be useful: viewtopic.php?f=32&t=6704&p=49677#p49754