Safely Remove a Pin Drive

Discussion in 'Web Design & Coding' started by GCNPlayer5, Jun 8, 2006.

  1. GCNPlayer5

    GCNPlayer5 OSNN One Post Wonder

    Messages:
    5
    I was woundering if anyone could help me write a bat script for Windows 2000 that would safely remove my pin drive at a click of an icon?

    Any help would be wounderful
     
  2. kcnychief

    kcnychief █▄█ ▀█▄ █ Political User Folding Team

    Messages:
    16,948
    Location:
    Massachusetts
    Might be a dumb question, but what is a "pin drive"? Are you referring to the "safely remove a USB device" icon in the taskbar?
     
  3. GCNPlayer5

    GCNPlayer5 OSNN One Post Wonder

    Messages:
    5
  4. ming

    ming OSNN Advanced

    Messages:
    4,252
    Location:
    UK
    same thought. :D

    normally, I just yank the usb device out of the port... ;)

    posts merged
     
  5. GCNPlayer5

    GCNPlayer5 OSNN One Post Wonder

    Messages:
    5
    that doesnt work to well in Win 2k sometimes it never writes the data untill you Safely remove the device. I don't understand it but it is Win 2k
     
  6. VenomXt

    VenomXt Blame me for the RAZR's Folding Team

    Messages:
    3,453
    Location:
    Houston, Texas
    the sad thing is, he is right. win2k is very bad about not putting the files on the drive if you just pull it out even after the transfer.
     
  7. GCNPlayer5

    GCNPlayer5 OSNN One Post Wonder

    Messages:
    5
    so anyone know how to write a script that will safely remove it for me?
     
  8. xsivforce

    xsivforce Prodigal Son Folding Team

    Messages:
    8,547
    Location:
    Texas, USA
    I don't remember if 2k has it but when I remove a drive like that in xp, I right click the drive in explorer and click "eject".
     
  9. GCNPlayer5

    GCNPlayer5 OSNN One Post Wonder

    Messages:
    5
    ok i want a SCRIPT to do it. In 2k3 you have to right click on it and the go unplug, then it wants to know what port the device is, and then it wants to make sure it has the correct device so it does it asks again.

    I am a help desk Tech. I am to much in a hurry trying to get away from the person that i am helping.
     
  10. X-Istence

    X-Istence * Political User

    Messages:
    6,498
    Location:
    USA
    Easiest thing is to set the drive write protected, which can be done on most drives by sliding something, which means you can just yank it out.
     
  11. LeeJend

    LeeJend Moderator

    Messages:
    5,291
    Location:
    Fort Worth, TX
    The drives don't have write protect switches anymore. None of my three do.

    Someone has to have fast hack for this. Even XP makes me go through 3 menu's to remove a thumb drive.
     
  12. gh057

    gh057 w3lc0m3 t0 7h3 r3al w0r1d

    Messages:
    62
    Location:
    nyc
    Hello ,

    I have a similar problem in XP . I dont see the Safely Remove Hardware button on the Taskbar , so I tried to unhide it using the Taskbar properties but they are grayed out , also when I try to remove them using the MyComputer > Properties > Hardware > Device Manager and try to get the Safely Remove Wizard Its also grayed out.

    Another option I have tried is to right click on the USB Flash Drive and Click Eject but I get the following error " windows cannot safely remove the hardware , a process is using it." Funny thing about this is that this happens even if i just plug in the usb drive and try to remove it without copying or deleting anything .

    Any ideas ? Maybe bad Flash drive ?

    Thanks
    gh057
     
  13. roirraW "edor" ehT

    roirraW "edor" ehT Builder/Installer

    Messages:
    529
    Okay, this is weird. I've never had that experience (having to go through 3 menus to remove a thumb or any other removable drive).

    You can right click and select your device from a more complicated menu but you can also left click instead then select the drive from the pop-up menu.

    I don't remember if Windows 2000 has all these options, but in XP and Vista for thumb drives there's an option in the Device Mangager for "Optimize for quick removal" and "Optimize for performance".

    Basically if you have your thumb drive plugged in, then go to the device menu, expand the lists of Disk Drives and double-click on your thumb drive listed there. Then select the Policies tab and there's the two options. In theory if you choose "Optimize for quick removal" then you don't have to use the Safely Remove Hardware notifcation icon. Like I said, in theory so don't blame me. :)

    Other drives (hard drives, et cetera) might have other performance options you may be interested in as well. Different Windows installations combined with different hardware and drivers will produce different defaults as to what options are selected already. Even on my machines without battery backup, I always choose the highest performing mode.
     
  14. gh057

    gh057 w3lc0m3 t0 7h3 r3al w0r1d

    Messages:
    62
    Location:
    nyc
    Thats the problem the policies are grayed out , I cant modify them ... I think has to do w/ my companies rights issue :-(.
     
  15. roirraW "edor" ehT

    roirraW "edor" ehT Builder/Installer

    Messages:
    529
    Not necessarily. Some drivers for some chipsets don't let you change the settings.

    My old workhorse's VIA 8237-based SATA RAID doesn't let me change it under XP either (grayed out).

    My newer AMD/ATI-based SATA RAID does let me change it under Vista.

    It depends on the chipset and the drivers. I know this happens even with old IDE without RAID too.