Formating usb

If you need help with a project or need to know how to do something specific in VB.NET then please ask your questions in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
4 posts Page 1 of 1
Contributors
User avatar
jtlusco
VIP - Donator
VIP - Donator
Posts: 138
Joined: Mon Jul 12, 2010 11:28 pm

Formating usb
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
Have you been scripted today
Image
User avatar
smashapps
Coding Guru
Coding Guru
Posts: 961
Joined: Tue Apr 05, 2011 8:41 am

Re: Formating usb
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.
My name is Tom | Visit my blog where I post new content every day! Tom's Daily Blog | MineCraft is awesome!
User avatar
Shim
VIP - Donator
VIP - Donator
Posts: 882
Joined: Wed Dec 14, 2011 5:02 am

Re: Formating usb
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
Find my programs on Softpedia
User avatar
mandai
Coding God
Coding God
Posts: 2585
Joined: Mon Apr 26, 2010 6:51 pm

Re: Formating usb
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
4 posts Page 1 of 1
Return to “Coding Help & Support”