How to make button to format a HardDrive or USB, How to remove all files from folder, and How to delete a process in listbox with a textbox?

Hello!
Here's the question with explaniation: How can i format the USB or Drive by clicking a button what's meant for it?
and the second question what's also in vb.net: How can i remove all files from folder ? 
 Here's the Look of program: *
Using the PC button, it will delete the free space of the PC, do you guys/girls know where it's location?

Example Code:
Imports System.Runtime.InteropServices
Imports System.IO
Public Class Form1
Dim CBoxDrives As New ComboBox
WithEvents FButton As New Button
<DllImport("shell32.dll")> _
Private Shared Function SHFormatDrive(ByVal hwnd As IntPtr, ByVal drive As UInteger, _
ByVal fmtID As UInteger, ByVal options As UInteger) As ULong
End Function
Private Enum SHFormatFlags As Integer
SHFMT_ID_DEFAULT = &HFFFF
SHFMT_OPT_FULL = &H1
SHFMT_OPT_SYSONLY = &H2
SHFMT_ERROR = &HFFFFFFFF
SHFMT_CANCEL = &HFFFFFFFE
SHFMT_NOFORMAT = &HFFFFFFD
SHFD_FORMAT_FULL = 0 ' full format
SHFD_FORMAT_QUICK = 1 ' quick format
End Enum
Private Sub FButton_Click_1(sender As System.Object, e As System.EventArgs) Handles FButton.Click
If CBoxDrives.Text = "" Then
MsgBox("No Drive Selected")
Exit Sub
End If
Dim Iresult As ULong = SHFormatDrive(CType(Me.Handle.ToInt32, IntPtr), CUInt(Asc(CBoxDrives.Text.Substring(0, 1)) - Asc("A")), CUInt(SHFormatFlags.SHFMT_ID_DEFAULT), 1)
End Sub
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
Me.Size = New Size(200, 100)
With FButton
.Size = New Size(50, 25)
.Location = New Point(5, 5)
.Text = "Format"
End With
Me.Controls.Add(FButton)
With CBoxDrives
.Size = New Size(50, 25)
.Location = New Point(75, 5)
.DropDownStyle = ComboBoxStyle.DropDown
End With
Me.Controls.Add(CBoxDrives)
Dim DrivesFound As Integer = 0
Dim allDrives() As DriveInfo = DriveInfo.GetDrives()
Dim d As DriveInfo
For Each d In allDrives
If ((d.DriveType = DriveType.Fixed) Or (d.DriveType = DriveType.Removable)) AndAlso Environment.GetEnvironmentVariable("SYSTEMROOT").StartsWith(d.Name) = False Then
CBoxDrives.Items.Add(d.Name)
DrivesFound += 1
End If
Next
CBoxDrives.SelectedIndex = DrivesFound - 1
End Sub
End Class

Similar Messages

  • Ipod 5 wasn't updating new playlists.  Removed all music from iPod and ended up with 34 GB of OTHER.  How do I remove this without doing a full restore?

    iPod 5 was not adding new playlists when synching (plenty of space remained in memory for it).  This happened around the time of the new update.  I removed all music from the iPod and when I went to resync the selected playlists, my OTHER portion of memory jumped up to 34GB and now there is not enough space on the iPod to put all my music back on.
    I've checked the usage of all the apps and photos, etc, it is pretty clear this is because of the music portion only.
    Is there anyway of removing this information?  Without doing a restore?  It is not jailbroken either.

    An "other" larger than about 1 1/2 GB indicates corrupted files.
    What is the Other on my iPhone and How to Remove It
    What is "Other" and What Can I Do About It?
    Next, usually restoring from backup eliminated the corrupted files. However, sometimes restoring to factory settings/new iPod is required.
    To restore from backup see:
    iOS: How to back up
    To restore to factory settings/new iPod see:
    iTunes: Restoring iOS software

  • I installed FoxTabs and it seems to have removed all of my Links and Organized Link pages I had set up with FastDial. How can I get my FastDial back?

    FoxTabs looked pretty cool and I was interested in using it, but I didn't expect it would remove all of my FastDial information that I have built up over the past 5 years!
    I would still like to do this, but I really need the FastDial pages restored, I have links I do not even remember and would be hard pressed to even come close to restoring what seems to be lost. It still shows FastDial as an installed add on, but it doesn't open to it. Please help!

    is it compatible with Firefox 5.0 ??

  • How to make buttons work in Interactive Adobe Forms

    Hi Experts,
    I am new to interactive form. Though i have worked in normal/non-Interactive form, i do not know how to make buttons work in interactive adobe forms using ABAP  (I don't know JAVA). Can any one help me out and walk me through to how to code in ABAP to make buttons work.
    Kind Regards,
    Sharat.

    Please refer to my earlier post ... You will get an idea
    Please refer to the below thread for detail solution
    Sample Interactive form example ?....urgent...
    Cheers
    Satya

  • Not clear how to make button iconic

    i am not clear how to make button in forms iconic and where that icons come.where i have to kept that specific icon.what is the path of the directory where to keep image

    Just to add a little on what Gerd said, for web deployed forms your icon files must be of type .gif
    You cannot have .ico files in web deployed forms
    For more information on Web deployed icons read [url http://www.oracle.com/technology/products/forms/pdf/webicons.pdf]Webicons
    If you're using client/server technology, you also specify the UI_ICON registry and put your icons under that directory. In client server you can use .ico files
    Tony

  • I cannot figure out how to make the text larger on an incoming email.  The finger method doesn't work and I cannot find any toolbar with which to do it.  I could find nothing in settings also.  Plese help and thank you.

    I cannot figure out how to make the text larger in a received email.  The finger method doesn't work and I can find no tool bar as I can for composing emails.  I can find nothing in settings.  Please help and thank you in advance.

    Hi there,
    Download a piece of software called TinkerTool - that might just solve your problem. I have used it myself to change the system fonts on my iMac. It is software and not an app.
    Good wishes,
    John.

  • HT2470 how would i go about taking multiple files from documents and make them part of 1 master file

    how would i go about taking multiple files from documents and make them into 1 master file? I want to put all documents associated with this project together for easier access.

    From the finder window, click File, click new folder, you can drag all documents into that Folder making it the master folder. You can ajso drag folders into the Master folder, and have them as sub-folders if you wish to  do that. Either way they will all be in one master folder.

  • Already deleted all files from my MINIMAC and still appears to have only 200 gb free. How do I format the macmini?

    Already deleted all files from my MINIMAC and still appears to have only 200 gb free. How do I format the macmini?

    If you deleted from within the OS, did you empty the Trash?

  • Why when I go to garageband and make a ring tone then try to sync it, It says all existing songs, movies and tv shows will be removed?

    Why when I go to garageband and make a ring tone then try to sync it, It says all existing songs, movies and tv shows will be removed?

    Oh ok. As far as music, no i have not synced music because it would load so much. I don't have movies or tv. I have never loaded ringtones before. So i am guessing they are connected to music. My apps do sync. So the best thing is to not sync and just drop them on my devices icon???
    oh, if I check sync music the button for entire music library is selected how do I get Selected playlist, artists, ect. selected. Right now everthing is grayed out.

  • I don't know much about computers can anyone walk me through this ? How Do I Change The Software Update Server Address On A Client  ? what do I open and how do i put it in the right spot?

    I don't know much about computers can anyone walk me through this ? How Do I Change The Software Update Server Address On A Client  ? what do I open and how do i put it in the right spot?

    The simplest method is to run a defaults command on the client Macs (easily pushed via Apple Remote Desktop):
    defaults write com.apple.SoftwareUpdate CatalogURL 'HTTP_URL_FOR_CATALOG'
    for a user. If you run it via sudo it will set it for whenever you use softwareupdate as root.
    The HTTP_URL_FOR_CATALOG has been changed with Mac OS X 10.6.  If you use MCX it will automatically pick the new catalog – however if  doing it manually the following URLs need to be used for whichever  client version is in question:
    Mac OS X 10.4: http://mysus.example.com:8088/index.sucatalog
    Mac OS X 10.5: http://mysus.example.com:8088/index-leopard.merged-1.sucatalog.sucatalog
    Mac OS X 10.6: http://mysus.example.com:8088/index-leopard-snowleopard.merged-1.sucatalog
    Mac OS X 10.7: http://mysus.example.com:8088/index-lion-snowleopard-leopard.merged-1.sucatalog
    Mac OS X 10.8: index-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog
    To double check this applied you can run the following command:
    /usr/libexec/PlistBuddy -c Print /Library/Preferences/com.apple.SoftwareUpdate.plist
    and /usr/libexec/PlistBuddy -c Print ~/Library/Preferences/com.apple.SoftwareUpdate.plist
    to see what settings are for the computer and user appropriately.
    If  this is working correctly when running Software Update (GUI) you should  see the server address appear in parenthesis in the title of the  window.
    MCX
    Another alternative is to use Workgroup  Manager to manage the preferences via MCX from your server. This can be  done for users, or for computers if they are bound to your Open Directory.
    If you are using 10.5 Server or newer: you can simply use the Software Update section under Preferences.
    Manually:
    Choose the accounts, computers, or groups to have the preference applied to.
    Click on Preferences, and then the Details tab
    Press the Add… button and navigate to /Library/Preferences/com.apple.SoftwareUpdate.plist
    Press Edit…
    Under Often, add a New Key and enter the name CatalogURL
    Make sure the type is string and then enter your SUS URL (eg. http://mysus.example.com:8088/index.sucatalog or if using 10.6: http://mysus.examle.com:8088/ – see above from the defaults section)
    Press  Apply Now, then Done. Once users/computers have refreshed their MCX  settings (usually the next login or restart) the new settings will take  over.
    If this is working correctly when running Software  Update (GUI) you should see the server address appear in parenthesis in  the title of the window.
    In order to have a system-wide configuration one has to run the following:
    sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate CatalogURL "http://your.updates-server.lan:8088/index.sucatalog"
    In order to correctly work both on Leopard and Snow Leopard the right command to issue is:
    defaults write /Library/Preferences/com.apple.SoftwareUpdate CatalogURL "http://your.updates-server.lan:8088/index-leopard-snowleopard.merged-1.sucatalog"
    Happily used and tested on my network
    The DNS trick that Chealion points out is fantastic. I use it at our office, and every computer on our LAN  will automatically pull the updates from the local repository at high  speed without any configuration.
    Create the swscan.apple.com DNS zone on your internal DNS server, and have it resolve via an A record to your Mac
    Tags: automaticupdates mac clients macosx setting as default software update
    Category: Serverfault
    Share
    0
    0
    Google +
    0
    0
    0
    5
    You might also like:
    Can I Update My Jb 4s To 6.1.2 Without Restore? Tue. Jan 21st, 2014
    Iphone 4 Not Charging After Update To IOS6 
    IPad 2 Not Updating To IOS 5.1 
    How To Resolve The â€âunable To Install Update” Error For OTA IOS Updates? 
    What Is â€âSoftware Update” Doing When It Says â€âChecking For New Software”? 
    Advertisement
    Comment
    - See more at:  http://www.eonlinegratis.com/2013/how-do-i-change-the-software-update-server-add ress-on-a-client-mac-to-use-my-own-server/#sthash.YhHp5zWk.dpuf

  • I have recently updated my CC programs to the latest version and now all of my files wont open by default into their respective programs, only if I open the program and go to file open and open the file from there. How can I fix this?

    I have recently updated my CC programs to the latest version (CC2014) and now all of my files wont open by default into their respective programs, only if I open the program and go to file>open and open the file from there. How can I fix this?
    I have tried 'Open with' and the version of the program now installed on my computer isn't even suggested as an option and when I browse for it, the file wont open with it anyway

    On Windows (don't know about Mac), the latest version will always take over the file association, and become the default for indd files. It's impossible to change it.
    But there is a plugin for ID that makes this possible. Never tried it myself.
    https://www.rorohiko.com/wordpress/downloads/lightning-brain-soxy/

  • How can i copy files from one external hard disk to another using macbook pro with retina display

    How can i copy files from one external hard drive to another using macbook pro with retina display?

    That's odd - if you open Disk Utility (Applications->Utilities) and select the disk(s), how are they formatted? If you're only going to be used with your Mac, they should be formatted as "Mac OS Extended (Journaled)".
    Clinton

  • How does one remove temporary files from Safari?  A friend logged on to her Facebook account using my iMac.  Now I can't remove her e-mail address from Facebook.  It was suggested to me that I try clearing temporary files from Safari but I can't find

    How does one remove temporary files from Safari?  A friend logged on to her Facebook account using my iMac running Mac OSX 10.7.5 and Safari 6.1.6.  Now I can't remove her e-mail address from my computer.  When I open Facebook her address shows in the user button.  I do not have a Facebook account.  It was suggested to me that I try clearing temporary files from Safari but I can't find anything that tells me how to do this.  Are temporary files the same as the cache?  It also was suggested that I try clearing Safari cache.  How do I do that?

    Check Safari/Preferences/Passwords to see if the Facebook account is there. If so, select it and remove it. If you are still having problems, Safari/Preferences/Advanced - enable the Develop menu, then go there and Empty Caches. Quit/reopen Safari and test. If that doesn't work, Safari/Reset Safari.

  • Got a new external hard drive. Transferred all files from old hard drive to new hard drive. Connected hard drive to macbook. How do I get all my files to be recognized by iTunes and my already made playlists??

    Got a new external hard drive. Transferred all files from old hard drive to new hard drive. Connected hard drive to macbook. How do I get all my files to be recognized by iTunes and my already made playlists??

    Trying to download photos from IPHONE, IPAD to IPHOTO in IMAC after installing new hard drive.
    How did you import the photos to iPad and iPhone?
    If the photos have been synced to the iPhone and iPad using iTunes, you cannot sync them back.
    See this document:  http://support.apple.com/kb/HT4236
    You can't reimport pictures synced from your computer to your device back to your computer. You can only import pictures in the Camera Roll or Saved Photos from your device to your computer. If you need to retrieve synced photos from your device:
    If your photos are not in the Camera Roll on your devices, save them to the Camera Roll, share them to the Photo Stream, mail the photos, or, if you have iPhoto on the devices, use iTunes Photo Sharing.
    http://help.apple.com/iphoto/iphone/2.0/?handbuch#blnkee26bc1
    Save photos to your computer using iTunes
    Connect your iOS device to your computer.
    Tap a photo, album, event, web journal, or slideshow and tap Share> iTunes.
    Tap Selected, or change the photos you want to save (if you are saving a slideshow skip to step 4):
    Select different photos: Tap Choose Photos, tap one or more photos, and tap Next.
    Select a range of photos: Tap Choose Photos, tap Range, tap the first and last photos in the range, and tap Next.
    Select all the photos in an album or event: Tap All.
    In iTunes, click the button for your device and click Apps at the top of the window.
    Below File Sharing, select iPhoto (in Apps).
    Select the Shared Photos folder under iPhoto Documents.
    Click Save To and select the location on your computer where you want to save the items.
    To view your photos, go to the Finder and look in the location you selected above.

  • I have to extract all files from a hard drive of a macbook pro that is no longer working. All I have to access the hard drive is a PC, is this possible, and if so how?

    I have to extract all files from a hard drive of a macbook pro that is no longer working. All I have to access the hard drive is a PC, is this possible, and if so how?

    You could try Paragon HFS+ for Windows. That would allow you to read and write files from a Mac-formatted drive.
    Clinton

Maybe you are looking for

  • How to make a layer from the ADF pivot table invisible , show-hide column-row-data

    Hello all , I need to create a pivottable with ADF 12c for reporting purposes. I have a table or view with 10 items of type VARCHAR2 , C1,C2,C3,C4,C5,C6,C7,C8,C9,C10  and   10 items of type NUMBER N1,N2,N3,N4,N5,N6,N7,N8,N9,N10 The items of type VARC

  • Create new JTable based on selection of previous table

    Hello All, I want to create a sort of selection table. I have a fairly large JTable that is row selectable. I want the user to be able to select some rows, and then create a smaller table just displaying the selected rows. The current problem I am ha

  • I'd like a "goto" like in my method

    here's my code:      bl = true;           do {                // apresentar o problema                try {                     System.out.println(p1 + escolhido.getOperacao() + p2 + " ?");                catch (NullPointerException npe) {           

  • Captioning Plugin - loading a local DFXP file?

    Hi, I am creating a CD-Rom presentation, the requirements of which are Video and multi-language captioning. I thought this would be a good opportunity to gain experience with OSMF. The first issue I have found is I can not get captioning to work from

  • Deletion of Appended searchhelp

    Hi Experts,                   I got a problem while deleting Appended searchhelp.please help me out with this. I have appended a serachhelp to the standard searchhelp.when i try to delete the Append serachhelp system is not allowing me delete saying