Donation Goal
Donate Now Goal amount for this year: 799 USD, Received: 100 USD (13%)
Please donate to help support this website. The funds will be used to purchase owned license of LiteSpeed Web Server Enterprise (2-CPU). It provides superior performance in terms of raw speed, scalability and anti-DDoS capabilities.

Automatically Close Running Programs and Eject USB PenDrive

Posted By Raymond In Category: Computer

May
8
2009

When you want to eject a connected USB drive from a computer, you’ll have to close all the programs that are ran from USB flash drive, or else you’ll get the error message saying “The device ‘Generic volume’ cannot be stopped right now. Try stopping the device again later.” Sometimes even after closing every possible application that is ran from the USB flash drive, you still can’t successfully stop the device. If this happens on my own computer, I have no problems with this issue because I could use Unlocker to unlock processes in use to successfully remove the drive.
Eject USB drive
This would be a problem when this happens to my flash drive that are connected to other computer which doesn’t have Unlocker installed. If I simply unplug my USB flash drive without safely removing it first, there is a risk of data corruption on my flash drive. I recently found a small tool from Jkwebtalks called EjectUSB which seems to be pretty interesting. From the name of that tool, it seemed like a normal utility to eject a plugged in USB drive but it actually does more than that.


EjectUSB is designed to be a simple utility to close all programs running from a specified drive or folder and then attempt ejection if a drive was specified. Extended functionality includes flushing the file cache, closing Explorer windows and removing registry entries and Recent Document shortcuts referencing the specified drive or folder.

There is no interface for EjectUSB. All you need to do is extract the zip file to your USB flash drive, and then run EjectUSB.exe whenever you want to eject your USB flash drive.
EjectUSB
You might be thinking what is the difference between ejecting the USB drive using this tool and the built-in Safely Remove Hardware in Windows? The good thing about EjectUSB is it automatically closes all running programs running from the USB drive. This way it’s very unlikely you’ll get the error that your device cannot be stopped now.

There’s also a settings.bat file where you can access the configuration of EjectUSB. As you can see, it is also able to perform cleanup functions, remove related Subst entries and many more which the Safely Remove Hardware is NOT capable of doing.
EjectUSB Settings
Other than using this tool to eject a plugged in device, you can also use it to close running programs that are ran from the partition where EjectUSB is. Let’s say you run a game that is installed in D: drive. If you have EjectUSB in D: drive as well, double clicking it will close the game. However this won’t affect the programs that are ran from other partitions such as your C: drive. EjectUSB can definitely work like a boss-key function to quickly shut off programs that can get you fired ;)

Your antivirus might warn you that EjectUSB is a trojan but it’s not. That is the side-effect of EjectUSB being an AutoIt3 script. You do not need to worry if you’ve downloaded it from the official EjectUSB website.

[ Download EjectUSB ]


Related posts:
  • Safely Close All Running Programs in Windows with Ability to Restart the Closed Programs
  • No More Worries When Running Untrusted Programs
  • Keep Application Running by Automatically ReRun When Closed
  • Restoring running programs missing from Windows Tray when Explorer.exe CRASH!
  • Stop Virus from Running Automatically When you Execute Files
    • Firdaus

      A useful tool. Thx raymond

    • BillyDaGreat

      Thank.. i diz software for a year

    • Sai Charan

      Great! You’ve linked back to JK, who never link back to your blog.

    • manoj

      hey… nice piece of information.. i always thought my usb stick gonna crash someday while displaying those msg.. i will use this utility now..

      thnx for the info…

    • k9

      Are all/most AutoIt3 scripts flagged as malicious pieces of software?

    • sheldon

      This show me as a torjan..
      http://www.pocketappreview.com/main/media//software_zip/EjectUSB.zip

      Gateway Anti-Virus Alert

      This request is blocked by the SonicWALL Gateway Anti-Virus Service. Name: Small.NCO_2 (Trojan)

    • Shail Shah

      Hi Ray!
      This Utility is not working on Windows Vista Home Premium x64!

    • ngoc an

      that greart! thank it so good ^^

    • lawiz

      nice.. will give a try ;)
      thx raymond ..

    • Ishaan

      Really good tool thx alot…

    • Jun

      thx!!!
      I wanted this for years!!

    • http://www.raymond.cc/ Raymond

      Sai Charan, I could start to get the ball rolling instead of waiting for other people to do it first.

      sheldon, read the last paragraph?

      Shail Shah, I am no programmer but most of the time an AutoIT script is flagged as malicious.

    • Liliput

      Thanks raymond, tis a good one. I also find “Unlocker” did a decent job too.

    • Merlin_Magii

      Thanks Raymond – hopefully this will sort out my problem with ejecting my Cruzer Micro.

    • http://usedlotofhell.deviantart.com HellNoire

      I used this script for a bit, found it useful, until it stopped working under Vista. Apparently, ESET liked to block it.

      If you’re using ESET’s security, you might want to have it allow the script, by either added it to the whitelist, or reinstalling it with the final option to allow potentiality unwanted programs.

      Yes it will lower your security a little but a little common sense should pick up the toolbars it would otherwise be pointing out.

    • Junn

      Thank you very much for this, Raymond. I wonder how come I didn’t find EjectUSB before.

      This is very useful!

    • webcadre

      very nice of you master raymond, thanks for this nice tool :)

    • http://dawiecool.com dawiecool

      very usefull. thanks

    • mohan

      Nice Share! Thanku !

    • GM_MiCrO

      Hmm, hey Raymond does this tool stay on the usb stick or on the computer?!?! I didn’t really read the article to throughly (is that how you spell it?!?). Also if it’s in an installable file couldn’t i just install it to the usb and execute it from the usb device? Thanks GM_MiCrO

    • bill

      As always, a very helpful post. Thank You, Raymond.

    • mafia87

      Great one.. Thank You.. :)

    • helmi

      this software not working on my OS. i use windows XP SP3. i clicked the exe file, but nothing happened

    • Ed

      Good tool.

      Now is there a tool to re-connect to USB drive after doing safely-remove, while the drive is not actually remove from the computer?

    • Akshay Chandrashekaran

      Hi Raymond

      I tried out the software.
      Kaspersky did not detect any malicious files in it. However, It does not work up to what you have written. I tested the software with windows media player running a movie and adobe acrobat showing a PDF file from the pen Drive.

      The icon of an arrow appears on the taskbar, but both were not closed. I had to manually stop them before ejectUSB could stop the explorer window and safely remove the pendrive.

      Cheers,
      Akshay

    • pjere

      why didnt you post today,pliz post,we all vote for you,pliz post.Post now :))

    • dobbod

      Thanks Ray, this is a great tool.

      I agree with Akshay Chandrashekaran, I’ve tried, the open files from thumbdrive have to be manually closed first before EjectUSB can fully disconnect thumbdrive from computer.

    Copyright © 2005-2012 - Raymond.CC Blog