Results 1 to 21 of 21

Thread: Safely Remove Hardware [RESOLVED]

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2005
    Location
    Scotland
    Posts
    123

    Resolved Safely Remove Hardware [RESOLVED]

    As most of you will know if you are using XP or any os and u have a usb flash drive connected via usb just simply pulling the flash drive out can damage it and even blow the chip

    I am using a publicly shared computer and if i try and click once or double click on the computers safely remove hardware wizard it comes up this operation has been cancelled due to restrictions on this computer

    so i need to know vb code which will safely remove a drive of my choice by typing its drive letter i e

    E:\

    help plz
    Last edited by Aaron Smith; Jun 10th, 2005 at 03:56 AM.
    Regards
    Aaron Smith

    Did my post help you, rate my post

    When Quoting VB Code use [vbcode][/vbcode]

    When your problem has been resolved change to *subject* [RESOLVED]

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Safely Remove Hardware

    Quote Originally Posted by Aaron Smith
    I am using a publicly shared computer and if i try and click once or double click on the computers safely remove hardware wizard it comes up this operation has been cancelled due to restrictions on this computer
    An observation and a question.

    Observation: If your computer has restrictions placed on it that you do not have the administrative ability to remove or alter, then you are not going to be able to programmatically do anything these restrictions prohibit.

    Question: Why are you attempting to circumvent these restrictions? This question sounds somewhat ominious.

  3. #3
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Safely Remove Hardware

    most usb devices can be just be removed, as long as write cacheing is not enabled (usually not) and you wait for any write operation to complete, i have not known of one being fried, but i have of lost data from being removed to soon

    in device manager under disk drives it has provision to run the safly remove hardware, as well as optimise for quick removal, you will have to have a drive in to see these options, and they are set per device

    pete

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Mar 2005
    Location
    Scotland
    Posts
    123

    Re: Safely Remove Hardware

    Thanks for replying hack and to let you know about now being able to program round it i wasnt able to use my usb pen on the pub shared computer but now that i am using vb to do it i can use it now and i know that it is possible to do the safely remove hardware as i have seen it done but they aint gona give me the code for it

    Quote Originally Posted by westconn1
    most usb devices can be just be removed, as long as write cacheing is not enabled (usually not) and you wait for any write operation to complete, i have not known of one being fried, but i have of lost data from being removed to soon
    Thanks for replying westconn1 but if you do try and remove it it can blow the chip inside it as i have done this many time

    Thanks for helping
    Regards
    Aaron Smith

    Did my post help you, rate my post

    When Quoting VB Code use [vbcode][/vbcode]

    When your problem has been resolved change to *subject* [RESOLVED]

  5. #5
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Safely Remove Hardware

    Sounds like they don't want you taking code home with you.

    I've never hurt a usb device by removing it while it wasn't trying to communicate with the computer. If it was dangerous, you would also have the same danger when connecting it. Don't have it open in explorer or anywhere else.
    Wait a few seconds after you communicate (read/write) and then disconnect it.

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Mar 2005
    Location
    Scotland
    Posts
    123

    Re: Safely Remove Hardware

    Quote Originally Posted by dglienna
    Wait a few seconds after you communicate (read/write) and then disconnect it.
    Thanks for replying but if you plug a flash drive into a usb hub u will notice that the activation light does not come on straight away this is because it is communicating with the pc and thus connecting but to do the same but the opposite way about you need to use the safely remove hardware wizard

    Hopefully someone out there will no the code for this
    Regards
    Aaron Smith

    Did my post help you, rate my post

    When Quoting VB Code use [vbcode][/vbcode]

    When your problem has been resolved change to *subject* [RESOLVED]

  7. #7
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Safely Remove Hardware

    Quote Originally Posted by Aaron Smith
    Thanks for replying but if you plug a flash drive into a usb hub u will notice that the activation light does not come on straight away this is because it is communicating with the pc and thus connecting but to do the same but the opposite way about you need to use the safely remove hardware wizard

    Hopefully someone out there will no the code for this
    The Hub is communicating with it first, assigning an address. You didn't say that you are using a hub, anyways. If you disconnect it while the light is on, there probably will be a problem, but if it's off, I would doubt it.

    Can you get into Control Panel?

  8. #8
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: Safely Remove Hardware

    I am under the impression that SAFELY REMOVE HARDWARE only ensures that all cached activity is complete.

    I do not believe that any voltage changes occur anywhere on the USB port that would change whether physical damage would occur to the stick if it was removed.

    Can you please tell us where you got this information about frying a memory stick because it was removed prematurely?

    This link backs up my opinion...

    http://www.devhardware.com/forums/ar...k-reconnecting

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  9. #9

    Thread Starter
    Lively Member
    Join Date
    Mar 2005
    Location
    Scotland
    Posts
    123

    Re: Safely Remove Hardware

    had a look at your links and obviously there are dif opinions on this

    in reply to dglienna the light on my usb is always on when it is plugged in until u use the safely remove hardware wizard

    I didnt actually get this information from anywhere but all i know is i havew a lost a load of mem sticks that way and since at home i hav been using safely remove hardware i havent lost another one since so it must stop all current to power the drive so i need help
    Regards
    Aaron Smith

    Did my post help you, rate my post

    When Quoting VB Code use [vbcode][/vbcode]

    When your problem has been resolved change to *subject* [RESOLVED]

  10. #10
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Safely Remove Hardware

    in reply to dglienna the light on my usb is always on when it is plugged in until u use the safely remove hardware wizard
    You still haven't said if you were using a hub or not. If you were, it would power the stick, but may incorrectly identify when it was inactive, depending on the driver. I quit using the S-R-H tool a long time ago, and haven't ever lost any hardware that was USB.

  11. #11
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Safely Remove Hardware

    If you fry a USB drive it is a fault with the drive or motherboard and not the OS. As szlamany said the only thing the Safe Remove does is ensure cached activity is complete and then it unmounts the drive so no more read/write operations can occur. If you have write caching disabled (it can't actually be enabled with USB flash drives) then as long as the activity light is off you should be fine to remove it. I never use teh Safe Remove with flash drives and I've never even lost data, let alone blow any chips.

  12. #12
    Addicted Member WilliamRobinson's Avatar
    Join Date
    Feb 2005
    Posts
    219

    Re: Safely Remove Hardware

    Yes i believe this isn't true unless the device is still reading or writing then no damage will be done.
    Nothing is Impossible you say?......Try slamming a revolving door!

  13. #13
    VB Addict Pradeep1210's Avatar
    Join Date
    Apr 2004
    Location
    Inside the CPU...
    Posts
    6,614

    Re: Safely Remove Hardware

    I think Aaron Smith is right. We must stop the device and remove it safely. I have myself damaged my USB ports (my flash drive etc still working ) by removing it directly, though the lights on it was off.

    Pradeep
    Pradeep, Microsoft MVP (Visual Basic)
    Please appreciate posts that have helped you by clicking icon on the left of the post.
    "A problem well stated is a problem half solved." — Charles F. Kettering

    Read articles on My Blog101 LINQ SamplesJSON ValidatorXML Schema Validator"How Do I" videos on MSDNVB.NET and C# ComparisonGood Coding PracticesVBForums Reputation SaverString EnumSuper Simple Tetris Game


    (2010-2013)
    NB: I do not answer coding questions via PM. If you want my help, then make a post and PM me it's link. If I can help, trust me I will...

  14. #14
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Safely Remove Hardware

    If the device still works, you must have not pulled it straight out, causing the port to be shorted, but I'd blame that on a faulty setup to begin with, or else blame it on something else.

  15. #15

    Thread Starter
    Lively Member
    Join Date
    Mar 2005
    Location
    Scotland
    Posts
    123

    Re: Safely Remove Hardware

    Quote Originally Posted by Pradeep1210
    I think Aaron Smith is right. We must stop the device and remove it safely. I have myself damaged my USB ports (my flash drive etc still working ) by removing it directly, though the lights on it was off.
    Thanks for that Pradeep1210 i knew i was right about removing flash drives before it has been removed safely

    I am using a usb port not a hub but it always powers up the flash drive until it has been successfully removed

    Thanks for helping but more help is required
    Regards
    Aaron Smith

    Did my post help you, rate my post

    When Quoting VB Code use [vbcode][/vbcode]

    When your problem has been resolved change to *subject* [RESOLVED]

  16. #16
    Addicted Member WilliamRobinson's Avatar
    Join Date
    Feb 2005
    Posts
    219

    Re: Safely Remove Hardware

    Quote Originally Posted by Aaron Smith
    Thanks for that Pradeep1210 i knew i was right about removing flash drives before it has been removed safely

    I am using a usb port not a hub but it always powers up the flash drive until it has been successfully removed

    Thanks for helping but more help is required
    This doesnt prove anything until i see prove i dont believe Pradeep1210 has damged 1 or 2 usb ports that could be because many things, could have been a static build up in the mobo.

    Any1 else on my side here?

    William
    Nothing is Impossible you say?......Try slamming a revolving door!

  17. #17

    Thread Starter
    Lively Member
    Join Date
    Mar 2005
    Location
    Scotland
    Posts
    123

    Re: Safely Remove Hardware

    Quote Originally Posted by WilliamRobinson
    Any1 else on my side here?
    It aint a battle WilliamRobinson i am just not wanting to damage any more of my enquipment
    Regards
    Aaron Smith

    Did my post help you, rate my post

    When Quoting VB Code use [vbcode][/vbcode]

    When your problem has been resolved change to *subject* [RESOLVED]

  18. #18
    VB Addict Pradeep1210's Avatar
    Join Date
    Apr 2004
    Location
    Inside the CPU...
    Posts
    6,614

    Re: Safely Remove Hardware

    Quote Originally Posted by WilliamRobinson
    This doesnt prove anything until i see prove i dont believe Pradeep1210 has damged 1 or 2 usb ports that could be because many things, could have been a static build up in the mobo.

    Any1 else on my side here?

    William
    Sorry if u don't believe me but it's a fact.
    I was also seeking an answer to this problem in this forum but there's not a single reply yet http://www.vbforums.com/showthread.php?t=343380

    Pradeep
    Pradeep, Microsoft MVP (Visual Basic)
    Please appreciate posts that have helped you by clicking icon on the left of the post.
    "A problem well stated is a problem half solved." — Charles F. Kettering

    Read articles on My Blog101 LINQ SamplesJSON ValidatorXML Schema Validator"How Do I" videos on MSDNVB.NET and C# ComparisonGood Coding PracticesVBForums Reputation SaverString EnumSuper Simple Tetris Game


    (2010-2013)
    NB: I do not answer coding questions via PM. If you want my help, then make a post and PM me it's link. If I can help, trust me I will...

  19. #19

    Thread Starter
    Lively Member
    Join Date
    Mar 2005
    Location
    Scotland
    Posts
    123

    Re: Safely Remove Hardware [STILL NEEDING HELP]

    thanks for your help
    Regards
    Aaron Smith

    Did my post help you, rate my post

    When Quoting VB Code use [vbcode][/vbcode]

    When your problem has been resolved change to *subject* [RESOLVED]

  20. #20
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: Safely Remove Hardware [RESOLVED]

    Seems to be a lot of assumptions and misinformation going around in this thread.

    SAFELY REMOVE HARDWARD is a device driver (software) setting to finish writing to a device.

    Voltage is always on with a USB port - nothing turns that off.

    I had a keyboard - USB - that had two extra USB ports on it. It's a bus - always active.

    I would need to see a hardware spec site from the web say something different then this - otherwise it's just urban legend...

    And this is where it starts

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  21. #21

    Thread Starter
    Lively Member
    Join Date
    Mar 2005
    Location
    Scotland
    Posts
    123

    Re: Safely Remove Hardware [RESOLVED]

    lol kk
    Regards
    Aaron Smith

    Did my post help you, rate my post

    When Quoting VB Code use [vbcode][/vbcode]

    When your problem has been resolved change to *subject* [RESOLVED]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width